diff --git a/StabilityMatrix/InstallPage.xaml b/StabilityMatrix/InstallPage.xaml index da198199..7c0f5c0d 100644 --- a/StabilityMatrix/InstallPage.xaml +++ b/StabilityMatrix/InstallPage.xaml @@ -10,7 +10,9 @@ xmlns:viewModels="clr-namespace:StabilityMatrix.ViewModels" d:DesignHeight="700" d:DesignWidth="1100" - ui:Design.Background="#202020" + Loaded="InstallPage_OnLoaded" + Background="{DynamicResource ApplicationBackgroundBrush}" + Foreground="{DynamicResource TextFillColorPrimaryBrush}" mc:Ignorable="d"> @@ -21,7 +23,6 @@ diff --git a/StabilityMatrix/InstallPage.xaml.cs b/StabilityMatrix/InstallPage.xaml.cs index 1f7301ca..4c915c1a 100644 --- a/StabilityMatrix/InstallPage.xaml.cs +++ b/StabilityMatrix/InstallPage.xaml.cs @@ -18,9 +18,9 @@ namespace StabilityMatrix DataContext = new InstallerViewModel(); } - private void InstallPage_OnLoaded(object sender, RoutedEventArgs e) + private async void InstallPage_OnLoaded(object sender, RoutedEventArgs e) { - ((InstallerViewModel) DataContext).OnLoaded(); + await ((InstallerViewModel) DataContext).OnLoaded(); } } } diff --git a/StabilityMatrix/MainWindow.xaml b/StabilityMatrix/MainWindow.xaml index df114706..9eae8d4e 100644 --- a/StabilityMatrix/MainWindow.xaml +++ b/StabilityMatrix/MainWindow.xaml @@ -46,7 +46,7 @@ - + diff --git a/StabilityMatrix/SettingsPage.xaml b/StabilityMatrix/SettingsPage.xaml index 27d12df8..695a6a1e 100644 --- a/StabilityMatrix/SettingsPage.xaml +++ b/StabilityMatrix/SettingsPage.xaml @@ -1,4 +1,5 @@ + - + d:DesignHeight="700" + d:DesignWidth="1100" + Background="{DynamicResource ApplicationBackgroundBrush}" + Foreground="{DynamicResource TextFillColorPrimaryBrush}" + mc:Ignorable="d"> + - + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + diff --git a/StabilityMatrix/ViewModels/InstallerViewModel.cs b/StabilityMatrix/ViewModels/InstallerViewModel.cs index b6ddc759..eb8756eb 100644 --- a/StabilityMatrix/ViewModels/InstallerViewModel.cs +++ b/StabilityMatrix/ViewModels/InstallerViewModel.cs @@ -25,9 +25,10 @@ internal class InstallerViewModel : INotifyPropertyChanged ProgressValue = 0; } - public void OnLoaded() + public Task OnLoaded() { SelectedPackage = Packages.First(); + return Task.CompletedTask; } public static ObservableCollection Packages => new() @@ -75,7 +76,6 @@ internal class InstallerViewModel : INotifyPropertyChanged get => selectedPackage; set { - if (Equals(value, selectedPackage)) return; selectedPackage = value; OnPropertyChanged(); } diff --git a/StabilityMatrix/ViewModels/SettingsViewModel.cs b/StabilityMatrix/ViewModels/SettingsViewModel.cs index 6a9e371e..479bc578 100644 --- a/StabilityMatrix/ViewModels/SettingsViewModel.cs +++ b/StabilityMatrix/ViewModels/SettingsViewModel.cs @@ -1,6 +1,7 @@ using System.Collections.ObjectModel; using System.ComponentModel; using System.Runtime.CompilerServices; +using Wpf.Ui.Appearance; namespace StabilityMatrix.ViewModels; @@ -23,17 +24,15 @@ internal class SettingsViewModel : INotifyPropertyChanged selectedTheme = value; OnPropertyChanged(); - // TODO: redo for new UI Framework - // Update theme - // switch (selectedTheme) - // { - // case "Light": - // Application.Current.RequestedTheme = ApplicationTheme.Light; - // break; - // case "Dark": - // Application.Current.RequestedTheme = ApplicationTheme.Dark; - // break; - // } + switch (selectedTheme) + { + case "Light": + Theme.Apply(ThemeType.Light); + break; + case "Dark": + Theme.Apply(ThemeType.Dark); + break; + } } }