HypernovaDesktop Components · docs
Binarymission
WPF › Skinning › WindowsAppearance

WindowsAppearance

class.NET 6 / 8 / 10.NET Framework 4.8Binarymission.WPF.Skinning

Reads the light or dark mode and the accent colour the user has chosen in Windows' personalisation settings.

public static class WindowsAppearance

Remarks

Both are read afresh on every call, so they always say how Windows is set now. Neither throws: a setting that cannot be read gives the light mode and no accent.

Examples

Color accent = WindowsAppearance.AccentColor ?? BinarySkins.DefaultAccent;
BinarySkinTheme theme = WindowsAppearance.IsDarkMode ? BinarySkinTheme.Black : BinarySkinTheme.White;
BinarySkinManager.Apply(BinarySkins.Create(theme, accent));

Members at a glance

Properties
AccentColorGets the accent colour chosen in Windows.
IsDarkModeGets whether Windows is set to dark mode for applications.

Properties

AccentColor static

public static Color? AccentColor

Gets the accent colour chosen in Windows.

Value
The accent, opaque; null where Windows does not keep one or it cannot be read.

IsDarkMode static

public static bool IsDarkMode

Gets whether Windows is set to dark mode for applications.

Value
true when the user has chosen dark for apps; false when light, or when the setting cannot be read (Windows before 10).