From 1246a011c9c5705fbeec2f025266651490a9fd50 Mon Sep 17 00:00:00 2001 From: Maksym Katsydan Date: Sat, 12 Nov 2022 02:23:58 -0500 Subject: [PATCH 01/10] Update Avalonia to 11.0 --- src/App.axaml | 14 +---- src/App.axaml.cs | 47 +++++++---------- src/ApplicationTheme.cs | 4 +- src/AvaloniaCoreRTDemo.csproj | 57 ++++++--------------- src/Controls/ViewModels/MainViewModel.cs | 7 +-- src/Program.cs | 4 -- src/Utilities.cs | 20 ++++---- src/Windows/MainWindow.axaml | 50 ++++++++++-------- src/Windows/MainWindowMacOS.axaml | 26 ---------- src/Windows/MainWindowMacOS.axaml.cs | 28 ---------- src/Windows/ViewModels/MainViewModel.cs | 8 +-- src/Windows/ViewModels/MainViewModelBase.cs | 2 +- 12 files changed, 83 insertions(+), 184 deletions(-) delete mode 100644 src/Windows/MainWindowMacOS.axaml delete mode 100644 src/Windows/MainWindowMacOS.axaml.cs diff --git a/src/App.axaml b/src/App.axaml index e058919..e5fccaf 100644 --- a/src/App.axaml +++ b/src/App.axaml @@ -1,18 +1,8 @@ - - - - - - - - - - - - + + \ No newline at end of file diff --git a/src/App.axaml.cs b/src/App.axaml.cs index e05cb41..f760a54 100644 --- a/src/App.axaml.cs +++ b/src/App.axaml.cs @@ -4,7 +4,7 @@ using Avalonia.Controls.ApplicationLifetimes; using Avalonia.Markup.Xaml; using Avalonia.Styling; using Avalonia.Themes.Fluent; - +using Avalonia.Themes.Simple; using AvaloniaCoreRTDemo.Interfaces; using AvaloniaCoreRTDemo.Windows; @@ -12,11 +12,8 @@ namespace AvaloniaCoreRTDemo { public sealed class App : Application, IThemeSwitch { - private IStyle _baseLight; - private IStyle _baseDark; - - private IStyle _fluentLight; - private IStyle _fluentDark; + private FluentTheme _fluentTheme; + private SimpleTheme _simpleTheme; private ApplicationTheme _currentTheme; @@ -31,7 +28,7 @@ namespace AvaloniaCoreRTDemo this.InitializeThemes(); if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) { - desktop.MainWindow = !Utilities.IsOSX ? new MainWindow() : new MainWindowMacOS(); + desktop.MainWindow = new MainWindow(); this.DataContext = desktop.MainWindow.DataContext; } base.OnFrameworkInitializationCompleted(); @@ -39,15 +36,11 @@ namespace AvaloniaCoreRTDemo private void InitializeThemes() { - this._baseDark = this.Styles[0]; - this._baseLight = this.Styles[1]; + this._fluentTheme = (FluentTheme)this.Resources["fluentTheme"]!; + this._simpleTheme = (SimpleTheme)this.Resources["simpleTheme"]!; + Styles.Add(_fluentTheme); - this.Styles.Remove(this._baseDark); - - this._fluentLight = (FluentTheme)this.Resources["fluentLight"]!; - this._fluentDark = (FluentTheme)this.Resources["fluentDark"]!; - - this._currentTheme = ApplicationTheme.DefaultLight; + this._currentTheme = ApplicationTheme.FluentLight; } ApplicationTheme IThemeSwitch.Current => this._currentTheme; @@ -57,25 +50,21 @@ namespace AvaloniaCoreRTDemo this._currentTheme = theme; switch (theme) { - case ApplicationTheme.DefaultLight: - this.Styles[0] = this._baseLight; - this.Styles.Remove(this._baseDark); + case ApplicationTheme.SimpleLight: + this._simpleTheme.Mode = SimpleThemeMode.Light; + this.Styles[0] = this._simpleTheme; break; - case ApplicationTheme.DefaultDark: - this.Styles[0] = this._baseDark; - this.Styles.Remove(this._baseLight); + case ApplicationTheme.SimpleDark: + this._simpleTheme.Mode = SimpleThemeMode.Dark; + this.Styles[0] = this._simpleTheme; break; case ApplicationTheme.FluentLight: - this.Styles[0] = this._fluentLight; - this.Styles.Remove(this._fluentDark); - if (!this.Styles.Contains(this._baseLight)) - this.Styles.Add(this._baseLight); + this._fluentTheme.Mode = FluentThemeMode.Light; + this.Styles[0] = this._fluentTheme; break; case ApplicationTheme.FluentDark: - this.Styles[0] = this._fluentDark; - this.Styles.Remove(this._baseLight); - if (!this.Styles.Contains(this._baseDark)) - this.Styles.Add(this._baseDark); + this._fluentTheme.Mode = FluentThemeMode.Dark; + this.Styles[0] = this._fluentTheme; break; } } diff --git a/src/ApplicationTheme.cs b/src/ApplicationTheme.cs index 2323998..a7c55b0 100644 --- a/src/ApplicationTheme.cs +++ b/src/ApplicationTheme.cs @@ -4,8 +4,8 @@ namespace AvaloniaCoreRTDemo { public enum ApplicationTheme : Byte { - DefaultLight = 0, - DefaultDark = 1, + SimpleLight = 0, + SimpleDark = 1, FluentLight = 2, FluentDark = 3, } diff --git a/src/AvaloniaCoreRTDemo.csproj b/src/AvaloniaCoreRTDemo.csproj index 49ecbdf..274ea79 100644 --- a/src/AvaloniaCoreRTDemo.csproj +++ b/src/AvaloniaCoreRTDemo.csproj @@ -9,10 +9,10 @@ true link + true true true - OSX @@ -30,31 +30,34 @@ - - - PreserveNewest - - + + PreserveNewest - + + PreserveNewest + PreserveNewest + + + PreserveNewest PreserveNewest - - - - + + + + + - + - + $(AssemblyName) $(AssemblyName) com.$(username).$(AssemblyName) @@ -76,33 +79,5 @@ - - - - - App.axaml - - - - - - MainControl.axaml - - - AboutWindow.axaml - - - - - - MainWindow.axaml - - - - - - MainWindowMacOS.axaml - - diff --git a/src/Controls/ViewModels/MainViewModel.cs b/src/Controls/ViewModels/MainViewModel.cs index 29fc9f4..f1cea96 100644 --- a/src/Controls/ViewModels/MainViewModel.cs +++ b/src/Controls/ViewModels/MainViewModel.cs @@ -18,13 +18,10 @@ namespace AvaloniaCoreRTDemo.Controls.ViewModels public MainViewModel() { - this._dotNetImage = Utilities.GetImageFromFile(GetImageFullPath("dotnet.png")); - this._avaloniaImage = Utilities.GetImageFromFile(GetImageFullPath("avalonia.png")); + this._dotNetImage = Utilities.GetImageFromFile("dotnet.png"); + this._avaloniaImage = Utilities.GetImageFromFile("avalonia.png"); } - private static String GetImageFullPath(String fileName) - => Path.Combine(AppDomain.CurrentDomain.BaseDirectory, fileName); - ~MainViewModel() { this._dotNetImage.Dispose(); diff --git a/src/Program.cs b/src/Program.cs index 8478e3c..c689c49 100644 --- a/src/Program.cs +++ b/src/Program.cs @@ -12,10 +12,6 @@ namespace AvaloniaCoreRTDemo // Avalonia configuration, don't remove; also used by visual designer. public static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure().UsePlatformDetect() - .UseAvaloniaNativeOSX() .LogToTrace(); - - private static AppBuilder UseAvaloniaNativeOSX(this AppBuilder appBuilder) - => Utilities.IsOSX ? appBuilder.UseAvaloniaNative() : appBuilder; } } diff --git a/src/Utilities.cs b/src/Utilities.cs index 4296e91..3b740ec 100644 --- a/src/Utilities.cs +++ b/src/Utilities.cs @@ -1,10 +1,9 @@ using System; using System.IO; -using System.Linq; -using System.Reflection; using System.Runtime.InteropServices; - +using Avalonia; using Avalonia.Media.Imaging; +using Avalonia.Platform; namespace AvaloniaCoreRTDemo { @@ -15,25 +14,24 @@ namespace AvaloniaCoreRTDemo public static Bitmap GetImageFromResources(String fileName) { - Assembly asm = Assembly.GetExecutingAssembly(); - String resourceName = asm.GetManifestResourceNames().FirstOrDefault(str => str.EndsWith(fileName)); - if (resourceName != null) - using (Stream bitmapStream = asm.GetManifestResourceStream(resourceName)) - return new Bitmap(bitmapStream); - else - return default; + var assetLoader = AvaloniaLocator.Current.GetRequiredService(); + using var assetStream = assetLoader.Open(new Uri($"avares://AvaloniaCoreRTDemo/Images/{fileName}")); + return new Bitmap(assetStream); } public static Bitmap GetImageFromFile(String path) { try { - return new Bitmap(path); + return new Bitmap(GetImageFullPath(path)); } catch (Exception) { return GetImageFromResources("broken-link.png"); } } + + private static String GetImageFullPath(String fileName) + => Path.Combine(AppDomain.CurrentDomain.BaseDirectory, fileName); } } diff --git a/src/Windows/MainWindow.axaml b/src/Windows/MainWindow.axaml index f912199..29db8e0 100644 --- a/src/Windows/MainWindow.axaml +++ b/src/Windows/MainWindow.axaml @@ -1,21 +1,29 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Windows/MainWindowMacOS.axaml b/src/Windows/MainWindowMacOS.axaml deleted file mode 100644 index 4ea0793..0000000 --- a/src/Windows/MainWindowMacOS.axaml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Windows/MainWindowMacOS.axaml.cs b/src/Windows/MainWindowMacOS.axaml.cs deleted file mode 100644 index 9c25bcc..0000000 --- a/src/Windows/MainWindowMacOS.axaml.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Avalonia; -using Avalonia.Controls; -using Avalonia.Markup.Xaml; - -using AvaloniaCoreRTDemo.Interfaces; -using AvaloniaCoreRTDemo.Windows.ViewModels; - -namespace AvaloniaCoreRTDemo.Windows -{ - public partial class MainWindowMacOS : Window, IMainWindow - { - public MainWindowMacOS() - { - InitializeComponent(); -#if DEBUG - this.AttachDevTools(); -#endif - } - - private void InitializeComponent() - { - AvaloniaXamlLoader.Load(this); - this.DataContext = new MainViewModel(this); - } - - IThemeSwitch IMainWindow.ThemeSwitch => App.Current as IThemeSwitch; - } -} diff --git a/src/Windows/ViewModels/MainViewModel.cs b/src/Windows/ViewModels/MainViewModel.cs index a0acc74..b1b295e 100644 --- a/src/Windows/ViewModels/MainViewModel.cs +++ b/src/Windows/ViewModels/MainViewModel.cs @@ -51,8 +51,8 @@ namespace AvaloniaCoreRTDemo.Windows.ViewModels this.ChangeTheme(window.ThemeSwitch.Current); } - public void DefaultLightMethod() => this.ChangeTheme(ApplicationTheme.DefaultLight); - public void DefaultDarkMethod() => this.ChangeTheme(ApplicationTheme.DefaultDark); + public void DefaultLightMethod() => this.ChangeTheme(ApplicationTheme.SimpleLight); + public void DefaultDarkMethod() => this.ChangeTheme(ApplicationTheme.SimpleDark); public void FluentLightMethod() => this.ChangeTheme(ApplicationTheme.FluentLight); public void FluentDarkMethod() => this.ChangeTheme(ApplicationTheme.FluentDark); public override void HelpAboutMethod() => base.RunHelpAbout(this._window); @@ -62,8 +62,8 @@ namespace AvaloniaCoreRTDemo.Windows.ViewModels private void ChangeTheme(ApplicationTheme theme) { - this.DefaultLightEnabled = theme != ApplicationTheme.DefaultLight && theme != ApplicationTheme.FluentLight; - this.DefaultDarkEnabled = theme != ApplicationTheme.DefaultDark && theme != ApplicationTheme.FluentDark; + this.DefaultLightEnabled = theme != ApplicationTheme.SimpleLight && theme != ApplicationTheme.FluentLight; + this.DefaultDarkEnabled = theme != ApplicationTheme.SimpleDark && theme != ApplicationTheme.FluentDark; this.FluentLightEnabled = theme != ApplicationTheme.FluentLight; this.FluentDarkEnabled = theme != ApplicationTheme.FluentDark; this._window.ThemeSwitch?.ChangeTheme(theme); diff --git a/src/Windows/ViewModels/MainViewModelBase.cs b/src/Windows/ViewModels/MainViewModelBase.cs index c7faffd..d2b0b53 100644 --- a/src/Windows/ViewModels/MainViewModelBase.cs +++ b/src/Windows/ViewModels/MainViewModelBase.cs @@ -41,7 +41,7 @@ namespace AvaloniaCoreRTDemo.Windows.ViewModels private static Boolean IsDarkTheme(ApplicationTheme? theme) => theme switch { - ApplicationTheme.DefaultDark => true, + ApplicationTheme.SimpleDark => true, ApplicationTheme.FluentDark => true, _ => false, }; From 8459f9bf3bb3144c94cec49a958f5aafc4fe3b8b Mon Sep 17 00:00:00 2001 From: Maksym Katsydan Date: Sat, 12 Nov 2022 02:34:54 -0500 Subject: [PATCH 02/10] Use compiled bindings insteaed of reflection bindings --- src/Controls/MainControl.axaml | 7 +++- src/Windows/AboutWindow.axaml | 9 +++-- src/Windows/MainWindow.axaml | 9 ++++- src/Windows/ViewModels/AboutViewModel.cs | 26 ++++++------ src/Windows/ViewModels/MainViewModel.cs | 45 +++------------------ src/Windows/ViewModels/MainViewModelBase.cs | 45 ++++++++++++++++++++- 6 files changed, 80 insertions(+), 61 deletions(-) diff --git a/src/Controls/MainControl.axaml b/src/Controls/MainControl.axaml index cdf5d75..d443c2d 100644 --- a/src/Controls/MainControl.axaml +++ b/src/Controls/MainControl.axaml @@ -1,5 +1,8 @@ - + Welcome to Avalonia UI + NativeAOT! diff --git a/src/Windows/AboutWindow.axaml b/src/Windows/AboutWindow.axaml index 8ef32d8..bcd4700 100644 --- a/src/Windows/AboutWindow.axaml +++ b/src/Windows/AboutWindow.axaml @@ -1,6 +1,9 @@ - + diff --git a/src/Windows/MainWindow.axaml b/src/Windows/MainWindow.axaml index 29db8e0..e82bf20 100644 --- a/src/Windows/MainWindow.axaml +++ b/src/Windows/MainWindow.axaml @@ -1,6 +1,10 @@ + xmlns:controls="clr-namespace:AvaloniaCoreRTDemo.Controls" + xmlns:viewModels1="clr-namespace:AvaloniaCoreRTDemo.Windows.ViewModels" + mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="AvaloniaCoreRTDemo.Windows.MainWindow" + Width="640" Height="480" WindowStartupLocation="CenterScreen" Title="AvaloniaCoreRTDemo" Icon="avares://AvaloniaCoreRTDemo/Assets/app.ico" MinWidth="400" MinHeight="350" + x:CompileBindings="True" + x:DataType="viewModels1:MainViewModelBase"> @@ -11,6 +15,7 @@ + diff --git a/src/Windows/ViewModels/AboutViewModel.cs b/src/Windows/ViewModels/AboutViewModel.cs index b09161e..c252ac3 100644 --- a/src/Windows/ViewModels/AboutViewModel.cs +++ b/src/Windows/ViewModels/AboutViewModel.cs @@ -13,19 +13,19 @@ namespace AvaloniaCoreRTDemo.Windows.ViewModels private readonly Boolean _darkTheme; public IBitmap ComputerImage => _computerImage; - public static String NCores => Environment.ProcessorCount.ToString(); - public static String OS => RuntimeInformation.OSDescription; - public static String OSArch => RuntimeInformation.OSArchitecture.ToString(); - public static String OSVersion => Environment.OSVersion.ToString(); - public static String ComputerName => Environment.MachineName; - public static String UserName => Environment.UserName; - public static String SystemPath => Environment.SystemDirectory; - public static String CurrentPath => Environment.CurrentDirectory; - public static String ProcessArch => RuntimeInformation.ProcessArchitecture.ToString(); - public static String RuntimeName => RuntimeInformation.FrameworkDescription; - public static String RuntimePath => RuntimeEnvironment.GetRuntimeDirectory(); - public static String RuntimeVersion => RuntimeEnvironment.GetSystemVersion(); - public static String FrameworkVersion => Environment.Version.ToString(); + public String NCores => Environment.ProcessorCount.ToString(); + public String OS => RuntimeInformation.OSDescription; + public String OSArch => RuntimeInformation.OSArchitecture.ToString(); + public String OSVersion => Environment.OSVersion.ToString(); + public String ComputerName => Environment.MachineName; + public String UserName => Environment.UserName; + public String SystemPath => Environment.SystemDirectory; + public String CurrentPath => Environment.CurrentDirectory; + public String ProcessArch => RuntimeInformation.ProcessArchitecture.ToString(); + public String RuntimeName => RuntimeInformation.FrameworkDescription; + public String RuntimePath => RuntimeEnvironment.GetRuntimeDirectory(); + public String RuntimeVersion => RuntimeEnvironment.GetSystemVersion(); + public String FrameworkVersion => Environment.Version.ToString(); private String ComputerImageName { diff --git a/src/Windows/ViewModels/MainViewModel.cs b/src/Windows/ViewModels/MainViewModel.cs index b1b295e..07cf63d 100644 --- a/src/Windows/ViewModels/MainViewModel.cs +++ b/src/Windows/ViewModels/MainViewModel.cs @@ -12,54 +12,21 @@ namespace AvaloniaCoreRTDemo.Windows.ViewModels { private readonly TWindow _window; - private Boolean _defaultLightEnable = true; - private Boolean _defaultDarkEnable = true; - private Boolean _fluentLightEnable = true; - private Boolean _fluentDarkEnable = true; - - public Boolean DefaultLightEnabled - { - get => this._defaultLightEnable; - set => this.RaiseAndSetIfChanged(ref this._defaultLightEnable, value); - } - - public Boolean DefaultDarkEnabled - { - get => this._defaultDarkEnable; - set => this.RaiseAndSetIfChanged(ref this._defaultDarkEnable, value); - } - - public Boolean FluentLightEnabled - { - get => this._fluentLightEnable; - set => this.RaiseAndSetIfChanged(ref this._fluentLightEnable, value); - } - - public Boolean FluentDarkEnabled - { - get => this._fluentDarkEnable; - set => this.RaiseAndSetIfChanged(ref this._fluentDarkEnable, value); - } - - public ReactiveCommand FileExitCommand { get; } - public MainViewModel(TWindow window) : base(window.ThemeSwitch) { this._window = window; - this.FileExitCommand = ReactiveCommand.Create(RunFileExit); this.ChangeTheme(window.ThemeSwitch.Current); } - public void DefaultLightMethod() => this.ChangeTheme(ApplicationTheme.SimpleLight); - public void DefaultDarkMethod() => this.ChangeTheme(ApplicationTheme.SimpleDark); - public void FluentLightMethod() => this.ChangeTheme(ApplicationTheme.FluentLight); - public void FluentDarkMethod() => this.ChangeTheme(ApplicationTheme.FluentDark); + public override void HelpAboutMethod() => base.RunHelpAbout(this._window); - private void RunFileExit() - => Environment.Exit(0); - + public override void DefaultLightMethod() => this.ChangeTheme(ApplicationTheme.SimpleLight); + public override void DefaultDarkMethod() => this.ChangeTheme(ApplicationTheme.SimpleDark); + public override void FluentLightMethod() => this.ChangeTheme(ApplicationTheme.FluentLight); + public override void FluentDarkMethod() => this.ChangeTheme(ApplicationTheme.FluentDark); + private void ChangeTheme(ApplicationTheme theme) { this.DefaultLightEnabled = theme != ApplicationTheme.SimpleLight && theme != ApplicationTheme.FluentLight; diff --git a/src/Windows/ViewModels/MainViewModelBase.cs b/src/Windows/ViewModels/MainViewModelBase.cs index d2b0b53..f9d09da 100644 --- a/src/Windows/ViewModels/MainViewModelBase.cs +++ b/src/Windows/ViewModels/MainViewModelBase.cs @@ -1,5 +1,5 @@ using System; - +using System.Reactive; using Avalonia.Controls; using AvaloniaCoreRTDemo.Interfaces; @@ -12,6 +12,10 @@ namespace AvaloniaCoreRTDemo.Windows.ViewModels { private readonly IThemeSwitch _themeSwitch; private Boolean _aboutEnable = true; + private Boolean _defaultLightEnable = true; + private Boolean _defaultDarkEnable = true; + private Boolean _fluentLightEnable = true; + private Boolean _fluentDarkEnable = true; public Boolean AboutEnabled { @@ -20,10 +24,47 @@ namespace AvaloniaCoreRTDemo.Windows.ViewModels } public MainViewModelBase(IThemeSwitch window) - => this._themeSwitch = window; + { + this._themeSwitch = window; + this.FileExitCommand = ReactiveCommand.Create(RunFileExit); + } + public Boolean DefaultLightEnabled + { + get => this._defaultLightEnable; + set => this.RaiseAndSetIfChanged(ref this._defaultLightEnable, value); + } + + public Boolean DefaultDarkEnabled + { + get => this._defaultDarkEnable; + set => this.RaiseAndSetIfChanged(ref this._defaultDarkEnable, value); + } + + public Boolean FluentLightEnabled + { + get => this._fluentLightEnable; + set => this.RaiseAndSetIfChanged(ref this._fluentLightEnable, value); + } + + public Boolean FluentDarkEnabled + { + get => this._fluentDarkEnable; + set => this.RaiseAndSetIfChanged(ref this._fluentDarkEnable, value); + } + + public ReactiveCommand FileExitCommand { get; } + public abstract void HelpAboutMethod(); + public abstract void DefaultLightMethod(); + public abstract void DefaultDarkMethod(); + public abstract void FluentLightMethod(); + public abstract void FluentDarkMethod(); + + private void RunFileExit() + => Environment.Exit(0); + protected async void RunHelpAbout(Window currentWindow) { if (this.AboutEnabled) From 47f5732b84993470929a65837b8424f7a0aeeb6c Mon Sep 17 00:00:00 2001 From: Maksym Katsydan Date: Sat, 12 Nov 2022 03:48:48 -0500 Subject: [PATCH 03/10] Use net7 AOT --- src/AvaloniaCoreRTDemo.csproj | 30 +++++++--------------- src/nuget.config | 2 +- src/rd.xml | 48 ----------------------------------- 3 files changed, 10 insertions(+), 70 deletions(-) delete mode 100644 src/rd.xml diff --git a/src/AvaloniaCoreRTDemo.csproj b/src/AvaloniaCoreRTDemo.csproj index 274ea79..57a8a7f 100644 --- a/src/AvaloniaCoreRTDemo.csproj +++ b/src/AvaloniaCoreRTDemo.csproj @@ -3,12 +3,11 @@ WinExe - net6.0 + net7.0 x64 Assets/app.ico true - - link + true true true @@ -21,12 +20,8 @@ false false true + true - - - - - @@ -45,13 +40,13 @@ - - - - - + + + + + - + @@ -72,12 +67,5 @@ true - - - - - - - diff --git a/src/nuget.config b/src/nuget.config index 73b40f7..0fd24d3 100644 --- a/src/nuget.config +++ b/src/nuget.config @@ -1,7 +1,7 @@ - + diff --git a/src/rd.xml b/src/rd.xml deleted file mode 100644 index ba932c4..0000000 --- a/src/rd.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - From caea418ab5df63b3ba963039563ef0b42aa5c35a Mon Sep 17 00:00:00 2001 From: Maksym Katsydan Date: Sat, 12 Nov 2022 17:03:35 -0500 Subject: [PATCH 04/10] Add DataGrid to the About page --- src/App.axaml | 3 + src/App.axaml.cs | 8 +-- src/AvaloniaCoreRTDemo.csproj | 1 + src/Windows/AboutWindow.axaml | 73 +++++------------------- src/Windows/MainWindow.axaml | 3 + src/Windows/ViewModels/AboutViewModel.cs | 34 ++++++----- 6 files changed, 45 insertions(+), 77 deletions(-) diff --git a/src/App.axaml b/src/App.axaml index e5fccaf..42192bc 100644 --- a/src/App.axaml +++ b/src/App.axaml @@ -1,6 +1,9 @@ + + + diff --git a/src/App.axaml.cs b/src/App.axaml.cs index f760a54..4897feb 100644 --- a/src/App.axaml.cs +++ b/src/App.axaml.cs @@ -52,19 +52,19 @@ namespace AvaloniaCoreRTDemo { case ApplicationTheme.SimpleLight: this._simpleTheme.Mode = SimpleThemeMode.Light; - this.Styles[0] = this._simpleTheme; + this.Styles[1] = this._simpleTheme; break; case ApplicationTheme.SimpleDark: this._simpleTheme.Mode = SimpleThemeMode.Dark; - this.Styles[0] = this._simpleTheme; + this.Styles[1] = this._simpleTheme; break; case ApplicationTheme.FluentLight: this._fluentTheme.Mode = FluentThemeMode.Light; - this.Styles[0] = this._fluentTheme; + this.Styles[1] = this._fluentTheme; break; case ApplicationTheme.FluentDark: this._fluentTheme.Mode = FluentThemeMode.Dark; - this.Styles[0] = this._fluentTheme; + this.Styles[1] = this._fluentTheme; break; } } diff --git a/src/AvaloniaCoreRTDemo.csproj b/src/AvaloniaCoreRTDemo.csproj index 57a8a7f..6c272f8 100644 --- a/src/AvaloniaCoreRTDemo.csproj +++ b/src/AvaloniaCoreRTDemo.csproj @@ -42,6 +42,7 @@ + diff --git a/src/Windows/AboutWindow.axaml b/src/Windows/AboutWindow.axaml index bcd4700..58e9b80 100644 --- a/src/Windows/AboutWindow.axaml +++ b/src/Windows/AboutWindow.axaml @@ -1,67 +1,20 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + diff --git a/src/Windows/MainWindow.axaml b/src/Windows/MainWindow.axaml index e82bf20..0c5a4ca 100644 --- a/src/Windows/MainWindow.axaml +++ b/src/Windows/MainWindow.axaml @@ -7,6 +7,9 @@ x:DataType="viewModels1:MainViewModelBase"> + +