更新整理
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
|
||||
|
||||
|
||||
using WPFluent.Appearance;
|
||||
using WPFluent.Appearance;
|
||||
|
||||
namespace WPFluent;
|
||||
|
||||
@@ -10,30 +7,6 @@ namespace WPFluent;
|
||||
/// </summary>
|
||||
public partial class ThemeService : IThemeService
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public virtual SystemTheme GetNativeSystemTheme() => ApplicationThemeManager.GetSystemTheme();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public virtual ApplicationTheme GetSystemTheme()
|
||||
{
|
||||
SystemTheme systemTheme = ApplicationThemeManager.GetSystemTheme();
|
||||
|
||||
return systemTheme switch
|
||||
{
|
||||
SystemTheme.Light => ApplicationTheme.Light,
|
||||
SystemTheme.Dark => ApplicationTheme.Dark,
|
||||
SystemTheme.Glow => ApplicationTheme.Dark,
|
||||
SystemTheme.CapturedMotion => ApplicationTheme.Dark,
|
||||
SystemTheme.Sunrise => ApplicationTheme.Light,
|
||||
SystemTheme.Flow => ApplicationTheme.Light,
|
||||
SystemTheme.HCBlack => ApplicationTheme.HighContrast,
|
||||
SystemTheme.HC1 => ApplicationTheme.HighContrast,
|
||||
SystemTheme.HC2 => ApplicationTheme.HighContrast,
|
||||
SystemTheme.HCWhite => ApplicationTheme.HighContrast,
|
||||
_ => ApplicationTheme.Unknown,
|
||||
};
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public virtual ApplicationTheme GetTheme() => ApplicationThemeManager.GetAppTheme();
|
||||
|
||||
@@ -56,18 +29,10 @@ public partial class ThemeService : IThemeService
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool SetSystemAccent()
|
||||
{
|
||||
ApplicationAccentColorManager.ApplySystemAccent();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public virtual bool SetTheme(ApplicationTheme applicationTheme)
|
||||
{
|
||||
if(ApplicationThemeManager.GetAppTheme() == applicationTheme)
|
||||
if (ApplicationThemeManager.GetAppTheme() == applicationTheme)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user