|
|
@ -1,6 +1,7 @@ |
|
|
|
using System; |
|
|
|
using System; |
|
|
|
using System.Linq; |
|
|
|
using System.Linq; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using System.Threading.Tasks; |
|
|
|
|
|
|
|
using System.Windows; |
|
|
|
using System.Windows.Threading; |
|
|
|
using System.Windows.Threading; |
|
|
|
using System.Windows.Shell; |
|
|
|
using System.Windows.Shell; |
|
|
|
using CommunityToolkit.Mvvm.ComponentModel; |
|
|
|
using CommunityToolkit.Mvvm.ComponentModel; |
|
|
@ -88,15 +89,24 @@ public partial class MainWindowViewModel : ObservableObject |
|
|
|
|
|
|
|
|
|
|
|
private void SetTheme() |
|
|
|
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; |
|
|
|
var theme = settingsManager.Settings.Theme; |
|
|
|
switch (theme) |
|
|
|
switch (theme) |
|
|
|
{ |
|
|
|
{ |
|
|
|
case "Dark": |
|
|
|
case "Dark": |
|
|
|
Theme.Apply(ThemeType.Dark, WindowBackdropType.Acrylic); |
|
|
|
Theme.Apply(ThemeType.Dark, settingsManager.Settings.WindowBackdropType); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "Light": |
|
|
|
case "Light": |
|
|
|
Theme.Apply(ThemeType.Light, WindowBackdropType.Acrylic); |
|
|
|
Theme.Apply(ThemeType.Light, settingsManager.Settings.WindowBackdropType); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|