SystemThemeWatcher class¶
Defined in
Namespace: CrissCross.WPF.UI.Appearance
Assembly: CrissCross.WPF.UI.dll
Full name: CrissCross.WPF.UI.Appearance.SystemThemeWatcher
Modifiers: public static
Summary¶
Automatically updates the application background if the system theme or color is changed.
SystemThemeWatcher settings work globally and cannot be changed for each Window.
Applies to
net10.0-windows10.0.19041, net9.0-windows10.0.19041, net8.0-windows10.0.19041, net481
Examples¶
SystemThemeWatcher.Watch(this as System.Windows.Window);
SystemThemeWatcher.UnWatch(this as System.Windows.Window);
SystemThemeWatcher.Watch(
_serviceProvider.GetRequiredService<MainWindow>()
);
Methods¶
| Name | Summary |
|---|---|
| static Watch | Watches the Window and applies the background effect and theme according to the system theme. |
| static UnWatch | Unwatches the window and removes the hook to receive messages from the system. |