From 64e380926251130869829423c31d29f492efde08 Mon Sep 17 00:00:00 2001 From: "Valeriano A.R" Date: Sat, 5 Aug 2023 15:40:12 +0200 Subject: [PATCH] Add AvaloniaUI App project. --- CsvView.csproj => CsvView.Old.csproj | 2 +- CsvView.sln | 8 +++++++- CsvView.sln.DotSettings | 4 ++-- CsvView/App.axaml | 10 ++++++++++ CsvView/App.axaml.cs | 23 +++++++++++++++++++++++ CsvView/CsvView.csproj | 20 ++++++++++++++++++++ CsvView/MainWindow.axaml | 11 +++++++++++ CsvView/MainWindow.axaml.cs | 12 ++++++++++++ CsvView/Program.cs | 21 +++++++++++++++++++++ CsvView/app.manifest | 18 ++++++++++++++++++ 10 files changed, 125 insertions(+), 4 deletions(-) rename CsvView.csproj => CsvView.Old.csproj (99%) create mode 100644 CsvView/App.axaml create mode 100644 CsvView/App.axaml.cs create mode 100644 CsvView/CsvView.csproj create mode 100644 CsvView/MainWindow.axaml create mode 100644 CsvView/MainWindow.axaml.cs create mode 100644 CsvView/Program.cs create mode 100644 CsvView/app.manifest diff --git a/CsvView.csproj b/CsvView.Old.csproj similarity index 99% rename from CsvView.csproj rename to CsvView.Old.csproj index 97cb645..b870ec6 100644 --- a/CsvView.csproj +++ b/CsvView.Old.csproj @@ -8,7 +8,7 @@ WinExe Properties CsvView - CsvView + CsvView.Old v4.6.1 512 true diff --git a/CsvView.sln b/CsvView.sln index 1ccb1fb..4366a40 100644 --- a/CsvView.sln +++ b/CsvView.sln @@ -3,12 +3,14 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CsvView", "CsvView.csproj", "{587169B9-7891-4A2F-8537-9196898B86AF}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CsvView.Old", "CsvView.Old.csproj", "{587169B9-7891-4A2F-8537-9196898B86AF}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CsvLib", "CsvLib\CsvLib.csproj", "{EB0FDB60-8B9D-401C-85A8-4CF4105D5063}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CsvLib.Tests", "CsvLib.Tests\CsvLib.Tests.csproj", "{EC5C84D8-1CDE-4AED-9C16-6C4086A20893}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CsvView", "CsvView\CsvView.csproj", "{65A0A7DA-5884-4DFE-8223-C8F5DBD881A8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -27,6 +29,10 @@ Global {EC5C84D8-1CDE-4AED-9C16-6C4086A20893}.Debug|Any CPU.Build.0 = Debug|Any CPU {EC5C84D8-1CDE-4AED-9C16-6C4086A20893}.Release|Any CPU.ActiveCfg = Release|Any CPU {EC5C84D8-1CDE-4AED-9C16-6C4086A20893}.Release|Any CPU.Build.0 = Release|Any CPU + {65A0A7DA-5884-4DFE-8223-C8F5DBD881A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {65A0A7DA-5884-4DFE-8223-C8F5DBD881A8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {65A0A7DA-5884-4DFE-8223-C8F5DBD881A8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {65A0A7DA-5884-4DFE-8223-C8F5DBD881A8}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/CsvView.sln.DotSettings b/CsvView.sln.DotSettings index 9b6148b..f9ba49e 100644 --- a/CsvView.sln.DotSettings +++ b/CsvView.sln.DotSettings @@ -1,3 +1,3 @@  - /usr/lib/mono/msbuild/15.0/bin/MSBuild.dll - 983040 \ No newline at end of file + /usr/share/dotnet/sdk/7.0.107/MSBuild.dll + 4294967293 \ No newline at end of file diff --git a/CsvView/App.axaml b/CsvView/App.axaml new file mode 100644 index 0000000..1df1472 --- /dev/null +++ b/CsvView/App.axaml @@ -0,0 +1,10 @@ + + + + + + + \ No newline at end of file diff --git a/CsvView/App.axaml.cs b/CsvView/App.axaml.cs new file mode 100644 index 0000000..585757c --- /dev/null +++ b/CsvView/App.axaml.cs @@ -0,0 +1,23 @@ +using Avalonia; +using Avalonia.Controls.ApplicationLifetimes; +using Avalonia.Markup.Xaml; + +namespace CsvView; + +public partial class App : Application +{ + public override void Initialize() + { + AvaloniaXamlLoader.Load(this); + } + + public override void OnFrameworkInitializationCompleted() + { + if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) + { + desktop.MainWindow = new MainWindow(); + } + + base.OnFrameworkInitializationCompleted(); + } +} diff --git a/CsvView/CsvView.csproj b/CsvView/CsvView.csproj new file mode 100644 index 0000000..1496670 --- /dev/null +++ b/CsvView/CsvView.csproj @@ -0,0 +1,20 @@ + + + WinExe + net7.0 + enable + true + app.manifest + true + + + + + + + + + + + + diff --git a/CsvView/MainWindow.axaml b/CsvView/MainWindow.axaml new file mode 100644 index 0000000..0852b81 --- /dev/null +++ b/CsvView/MainWindow.axaml @@ -0,0 +1,11 @@ + + Hello CvsView! + diff --git a/CsvView/MainWindow.axaml.cs b/CsvView/MainWindow.axaml.cs new file mode 100644 index 0000000..5c17c5c --- /dev/null +++ b/CsvView/MainWindow.axaml.cs @@ -0,0 +1,12 @@ +using Avalonia.Controls; +using Avalonia.Interactivity; + +namespace CsvView; + +public partial class MainWindow : Window +{ + public MainWindow() + { + InitializeComponent(); + } +} diff --git a/CsvView/Program.cs b/CsvView/Program.cs new file mode 100644 index 0000000..977975b --- /dev/null +++ b/CsvView/Program.cs @@ -0,0 +1,21 @@ +using Avalonia; +using System; + +namespace CsvView; + +class Program +{ + // Initialization code. Don't use any Avalonia, third-party APIs or any + // SynchronizationContext-reliant code before AppMain is called: things aren't initialized + // yet and stuff might break. + [STAThread] + public static void Main(string[] args) => BuildAvaloniaApp() + .StartWithClassicDesktopLifetime(args); + + // Avalonia configuration, don't remove; also used by visual designer. + public static AppBuilder BuildAvaloniaApp() + => AppBuilder.Configure() + .UsePlatformDetect() + .WithInterFont() + .LogToTrace(); +} diff --git a/CsvView/app.manifest b/CsvView/app.manifest new file mode 100644 index 0000000..07df98d --- /dev/null +++ b/CsvView/app.manifest @@ -0,0 +1,18 @@ + + + + + + + + + + + + + +