1.1.3 -> 1.1.4 第10次更新

This commit is contained in:
Space Time 2024-11-24 12:58:49 +08:00
parent fe44a5231e
commit 5bd9ef3e58
2 changed files with 19 additions and 12 deletions

18
Preses/AppPres.cs Normal file
View File

@ -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);
}
}

View File

@ -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);