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¶
| Name | Summary |
|---|---|
| static IsHighContrast | Gets a value that indicates whether the application is currently using the high contrast theme. |
| static IsSystemHighContrast | Gets a value that indicates whether the Windows is currently using the high contrast theme. |
| static Apply | Changes the current application theme. |
| static ApplySystemTheme | Applies the system theme. |
| static GetAppTheme | Gets currently set application theme. |
| static GetSystemTheme | Gets currently set system theme. |
| static IsAppMatchesSystem | Gets a value that indicates whether the application is matching the system theme. |
| static IsMatchedDark | Checks if the application and the operating system are currently working in a dark theme. |
| static IsMatchedLight | Checks if the application and the operating system are currently working in a light theme. |
Events¶
| Name | Summary |
|---|---|
| static Changed | Event triggered when the application's theme is changed. |