diff --git a/StabilityMatrix/ViewModels/MainWindowViewModel.cs b/StabilityMatrix/ViewModels/MainWindowViewModel.cs index e6298fae..2efe9f91 100644 --- a/StabilityMatrix/ViewModels/MainWindowViewModel.cs +++ b/StabilityMatrix/ViewModels/MainWindowViewModel.cs @@ -1,6 +1,7 @@ using System; using System.Linq; using System.Threading.Tasks; +using System.Windows; using System.Windows.Threading; using System.Windows.Shell; using CommunityToolkit.Mvvm.ComponentModel; @@ -88,15 +89,24 @@ public partial class MainWindowViewModel : ObservableObject private void SetTheme() { - var theme = settingsManager.Settings.Theme; - switch (theme) + Application.Current.Dispatcher.BeginInvoke(() => { - case "Dark": - Theme.Apply(ThemeType.Dark, WindowBackdropType.Acrylic); - break; - case "Light": - Theme.Apply(ThemeType.Light, WindowBackdropType.Acrylic); - break; - } + if (Application.Current.MainWindow != null) + { + WindowBackdrop.ApplyBackdrop(Application.Current.MainWindow, + settingsManager.Settings.WindowBackdropType); + } + + var theme = settingsManager.Settings.Theme; + switch (theme) + { + case "Dark": + Theme.Apply(ThemeType.Dark, settingsManager.Settings.WindowBackdropType); + break; + case "Light": + Theme.Apply(ThemeType.Light, settingsManager.Settings.WindowBackdropType); + break; + } + }); } } diff --git a/StabilityMatrix/ViewModels/SettingsViewModel.cs b/StabilityMatrix/ViewModels/SettingsViewModel.cs index d3500283..1f3e1a2c 100644 --- a/StabilityMatrix/ViewModels/SettingsViewModel.cs +++ b/StabilityMatrix/ViewModels/SettingsViewModel.cs @@ -34,9 +34,7 @@ public partial class SettingsViewModel : ObservableObject public ObservableCollection AvailableBackdrops => new() { WindowBackdropType.Acrylic, - WindowBackdropType.Auto, WindowBackdropType.Mica, - WindowBackdropType.None, WindowBackdropType.Tabbed }; private readonly IContentDialogService contentDialogService;