diff --git a/Preses/AppPres.cs b/Preses/AppPres.cs new file mode 100644 index 0000000..c482542 --- /dev/null +++ b/Preses/AppPres.cs @@ -0,0 +1,18 @@ +using CommunityToolkit.Mvvm.ComponentModel; +using MaterialDesignThemes.Wpf; + +namespace Sheas_Cealer.Preses; + +internal partial class AppPres : ObservableObject +{ + [ObservableProperty] + private bool? isLightTheme = null; + partial void OnIsLightThemeChanged(bool? value) + { + PaletteHelper paletteHelper = new(); + Theme newTheme = paletteHelper.GetTheme(); + + newTheme.SetBaseTheme(value.HasValue ? value.GetValueOrDefault() ? BaseTheme.Light : BaseTheme.Dark : BaseTheme.Inherit); + paletteHelper.SetTheme(newTheme); + } +} \ No newline at end of file diff --git a/Preses/MainPres.cs b/Preses/MainPres.cs index 378f892..e84b03e 100644 --- a/Preses/MainPres.cs +++ b/Preses/MainPres.cs @@ -10,7 +10,7 @@ using File = System.IO.File; namespace Sheas_Cealer.Preses; -internal partial class MainPres : ObservableObject +internal partial class MainPres : AppPres { internal MainPres(string[] args) { @@ -70,17 +70,6 @@ internal partial class MainPres : ObservableObject } } - [ObservableProperty] - private bool? isLightTheme = null; - partial void OnIsLightThemeChanged(bool? value) - { - PaletteHelper paletteHelper = new(); - Theme newTheme = paletteHelper.GetTheme(); - - newTheme.SetBaseTheme(value.HasValue ? value.GetValueOrDefault() ? BaseTheme.Light : BaseTheme.Dark : BaseTheme.Inherit); - paletteHelper.SetTheme(newTheme); - } - [ObservableProperty] private bool isNginxExist = File.Exists(MainConst.NginxPath);