Skip to content

ApplicationThemeManager class

Defined in

Namespace: CrissCross.WPF.UI.Appearance Assembly: CrissCross.WPF.UI.dll Full name: CrissCross.WPF.UI.Appearance.ApplicationThemeManager Modifiers: public static

Summary

        Allows to manage the application theme by swapping resource dictionaries containing dynamic resources with color information.
        

Applies to

net10.0-windows10.0.19041, net9.0-windows10.0.19041, net8.0-windows10.0.19041, net481

Examples

ApplicationThemeManager.Apply(
 ApplicationTheme.Light
 );
if (ApplicationThemeManager.GetAppTheme() == ApplicationTheme.Dark)
 {
 ApplicationThemeManager.Apply(
 ApplicationTheme.Light
 );
 }
ApplicationThemeManager.Changed += (theme, accent) =>
 {
 Debug.WriteLine($"Application theme changed to {theme.ToString()}");
 };

Methods

NameSummary
static IsHighContrastGets a value that indicates whether the application is currently using the high contrast theme.
static IsSystemHighContrastGets a value that indicates whether the Windows is currently using the high contrast theme.
static ApplyChanges the current application theme.
static ApplySystemThemeApplies the system theme.
static GetAppThemeGets currently set application theme.
static GetSystemThemeGets currently set system theme.
static IsAppMatchesSystemGets a value that indicates whether the application is matching the system theme.
static IsMatchedDarkChecks if the application and the operating system are currently working in a dark theme.
static IsMatchedLightChecks if the application and the operating system are currently working in a light theme.

Events

NameSummary
static ChangedEvent triggered when the application's theme is changed.
Inherited members