From 7be89cf2e0eb76caec061a8ab8b9874a1dfd5d93 Mon Sep 17 00:00:00 2001 From: Matthew Parker Date: Tue, 29 Aug 2023 23:54:46 +1000 Subject: [PATCH] Basic Avalonia --- SlnAndCsprojParityChecker.sln | 6 +++++ SolutionParityChecker.App/App.axaml | 10 ++++++++ SolutionParityChecker.App/App.axaml.cs | 23 ++++++++++++++++++ SolutionParityChecker.App/MainWindow.axaml | 24 +++++++++++++++++++ SolutionParityChecker.App/MainWindow.axaml.cs | 22 +++++++++++++++++ .../MainWindowViewModel.cs | 7 ++++++ SolutionParityChecker.App/Models/AppState.cs | 6 +++++ SolutionParityChecker.App/Program.cs | 21 ++++++++++++++++ .../Services/DialogService.cs | 6 +++++ .../SolutionParityChecker.App.csproj | 20 ++++++++++++++++ SolutionParityChecker.App/app.manifest | 18 ++++++++++++++ 11 files changed, 163 insertions(+) create mode 100644 SolutionParityChecker.App/App.axaml create mode 100644 SolutionParityChecker.App/App.axaml.cs create mode 100644 SolutionParityChecker.App/MainWindow.axaml create mode 100644 SolutionParityChecker.App/MainWindow.axaml.cs create mode 100644 SolutionParityChecker.App/MainWindowViewModel.cs create mode 100644 SolutionParityChecker.App/Models/AppState.cs create mode 100644 SolutionParityChecker.App/Program.cs create mode 100644 SolutionParityChecker.App/Services/DialogService.cs create mode 100644 SolutionParityChecker.App/SolutionParityChecker.App.csproj create mode 100644 SolutionParityChecker.App/app.manifest diff --git a/SlnAndCsprojParityChecker.sln b/SlnAndCsprojParityChecker.sln index 586219f..6ad3fc2 100644 --- a/SlnAndCsprojParityChecker.sln +++ b/SlnAndCsprojParityChecker.sln @@ -4,6 +4,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SolutionParityChecker.CLI", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SolutionParityChecker", "SolutionParityChecker\SolutionParityChecker.csproj", "{2635CBAC-0CEF-4BEE-A6FD-154796A4F467}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SolutionParityChecker.App", "SolutionParityChecker.App\SolutionParityChecker.App.csproj", "{A7F46873-C8EC-4C2E-86F5-B9F2472C8036}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -18,5 +20,9 @@ Global {2635CBAC-0CEF-4BEE-A6FD-154796A4F467}.Debug|Any CPU.Build.0 = Debug|Any CPU {2635CBAC-0CEF-4BEE-A6FD-154796A4F467}.Release|Any CPU.ActiveCfg = Release|Any CPU {2635CBAC-0CEF-4BEE-A6FD-154796A4F467}.Release|Any CPU.Build.0 = Release|Any CPU + {A7F46873-C8EC-4C2E-86F5-B9F2472C8036}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A7F46873-C8EC-4C2E-86F5-B9F2472C8036}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A7F46873-C8EC-4C2E-86F5-B9F2472C8036}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A7F46873-C8EC-4C2E-86F5-B9F2472C8036}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/SolutionParityChecker.App/App.axaml b/SolutionParityChecker.App/App.axaml new file mode 100644 index 0000000..1c2e7ad --- /dev/null +++ b/SolutionParityChecker.App/App.axaml @@ -0,0 +1,10 @@ + + + + + + + \ No newline at end of file diff --git a/SolutionParityChecker.App/App.axaml.cs b/SolutionParityChecker.App/App.axaml.cs new file mode 100644 index 0000000..7d9302c --- /dev/null +++ b/SolutionParityChecker.App/App.axaml.cs @@ -0,0 +1,23 @@ +using Avalonia; +using Avalonia.Controls.ApplicationLifetimes; +using Avalonia.Markup.Xaml; + +namespace SolutionParityChecker.App; + +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() { DataContext = new MainWindowViewModel() }; + } + + base.OnFrameworkInitializationCompleted(); + } +} diff --git a/SolutionParityChecker.App/MainWindow.axaml b/SolutionParityChecker.App/MainWindow.axaml new file mode 100644 index 0000000..d6a5f57 --- /dev/null +++ b/SolutionParityChecker.App/MainWindow.axaml @@ -0,0 +1,24 @@ + + + + + + + + + Welcome to Avalonia! + + + + + + + diff --git a/SolutionParityChecker.App/MainWindow.axaml.cs b/SolutionParityChecker.App/MainWindow.axaml.cs new file mode 100644 index 0000000..5f79b9d --- /dev/null +++ b/SolutionParityChecker.App/MainWindow.axaml.cs @@ -0,0 +1,22 @@ +using Avalonia.Controls; +using Avalonia.Interactivity; + +namespace SolutionParityChecker.App; + +public partial class MainWindow : Window +{ + public MainWindow() + { + InitializeComponent(); + } + + private void LoadSolutionFolder(object? sender, RoutedEventArgs e) + { + SolutionFolderPath.Text = "Solution folder path"; + } + + private void LoadSolutionFile(object? sender, RoutedEventArgs e) + { + SolutionFilePath.Text = "Solution file path"; + } +} diff --git a/SolutionParityChecker.App/MainWindowViewModel.cs b/SolutionParityChecker.App/MainWindowViewModel.cs new file mode 100644 index 0000000..e866bd3 --- /dev/null +++ b/SolutionParityChecker.App/MainWindowViewModel.cs @@ -0,0 +1,7 @@ +namespace SolutionParityChecker.App; + +public class MainWindowViewModel +{ + public string SolutionFolderPath { get; set; } = string.Empty; + public string SolutionFilePath { get; set; } = string.Empty; +} diff --git a/SolutionParityChecker.App/Models/AppState.cs b/SolutionParityChecker.App/Models/AppState.cs new file mode 100644 index 0000000..d8c628c --- /dev/null +++ b/SolutionParityChecker.App/Models/AppState.cs @@ -0,0 +1,6 @@ +namespace SolutionParityChecker.App.Models; + +public class AppState +{ + +} \ No newline at end of file diff --git a/SolutionParityChecker.App/Program.cs b/SolutionParityChecker.App/Program.cs new file mode 100644 index 0000000..160e9f3 --- /dev/null +++ b/SolutionParityChecker.App/Program.cs @@ -0,0 +1,21 @@ +using Avalonia; +using System; + +namespace SolutionParityChecker.App; + +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(); +} \ No newline at end of file diff --git a/SolutionParityChecker.App/Services/DialogService.cs b/SolutionParityChecker.App/Services/DialogService.cs new file mode 100644 index 0000000..37492a4 --- /dev/null +++ b/SolutionParityChecker.App/Services/DialogService.cs @@ -0,0 +1,6 @@ +namespace SolutionParityChecker.App.Services; + +public class DialogService +{ + +} \ No newline at end of file diff --git a/SolutionParityChecker.App/SolutionParityChecker.App.csproj b/SolutionParityChecker.App/SolutionParityChecker.App.csproj new file mode 100644 index 0000000..f602f90 --- /dev/null +++ b/SolutionParityChecker.App/SolutionParityChecker.App.csproj @@ -0,0 +1,20 @@ + + + WinExe + net7.0 + enable + true + app.manifest + true + + + + + + + + + + + + diff --git a/SolutionParityChecker.App/app.manifest b/SolutionParityChecker.App/app.manifest new file mode 100644 index 0000000..e2aac00 --- /dev/null +++ b/SolutionParityChecker.App/app.manifest @@ -0,0 +1,18 @@ + + + + + + + + + + + + + +