using WPFluent.Appearance;
namespace WPFluent;
///
/// Lets you set the app theme.
///
public partial class ThemeService : IThemeService
{
///
public virtual ApplicationTheme GetTheme() => ApplicationThemeManager.GetAppTheme();
///
public bool SetAccent(Color accentColor)
{
ApplicationAccentColorManager.Apply(accentColor);
return true;
}
///
public bool SetAccent(SolidColorBrush accentSolidBrush)
{
Color color = accentSolidBrush.Color;
color.A = (byte)Math.Round(accentSolidBrush.Opacity * byte.MaxValue);
ApplicationAccentColorManager.Apply(color);
return true;
}
///
public virtual bool SetTheme(ApplicationTheme applicationTheme)
{
if (ApplicationThemeManager.GetAppTheme() == applicationTheme)
{
return false;
}
ApplicationThemeManager.Apply(applicationTheme);
return true;
}
}