|
|
|
@ -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() |
|
|
|
|
{ |
|
|
|
|
Application.Current.Dispatcher.BeginInvoke(() => |
|
|
|
|
{ |
|
|
|
|
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, WindowBackdropType.Acrylic); |
|
|
|
|
Theme.Apply(ThemeType.Dark, settingsManager.Settings.WindowBackdropType); |
|
|
|
|
break; |
|
|
|
|
case "Light": |
|
|
|
|
Theme.Apply(ThemeType.Light, WindowBackdropType.Acrylic); |
|
|
|
|
Theme.Apply(ThemeType.Light, settingsManager.Settings.WindowBackdropType); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|