HypernovaDesktop Components · docs
Binarymission
WPF › Skinning › BinarySkins

BinarySkins

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

Makes the built-in skins: the flat look of the current Office applications in four themes, in any accent colour.

public static class BinarySkins

Remarks

Each call makes a new skin, free to change before it is applied. The accent can be any colour: where it is drawn as text or as a line, it is made as dark or as light as it must be to read.

Examples

// Light or dark as the user has chosen in Windows, in the user's accent colour.
BinarySkinManager.Apply(BinarySkins.Create(BinarySkinTheme.System));

// The dark grey skin in the company's own colour.
BinarySkinManager.Apply(BinarySkins.Create(BinarySkinTheme.DarkGray, Color.FromRgb(0xE0, 0x6C, 0x1F)));

See also

Members at a glance

Methods
CreateMakes a built-in skin in the accent colour chosen in Windows.
CreateMakes a built-in skin in the given accent colour.
ResolveGets the theme a built-in skin is drawn as: BinarySkinTheme.System becomes BinarySkinTheme.White or BinarySkinTheme.Black as Windows is set now; any other theme is itself.
Fields
DefaultAccentThe accent used when neither the application nor Windows supplies one: a mid blue, #0F6CBD.

Methods

Create static

public static BinarySkin Create(BinarySkinTheme theme)

Makes a built-in skin in the accent colour chosen in Windows.

Parameters
theme
The built-in skin.
Returns

A new skin, free to change. Its accent is WindowsAppearance.AccentColor, or DefaultAccent where Windows keeps none.

Exceptions
ArgumentOutOfRangeException
theme is not a built-in skin.

Create static

public static BinarySkin Create(BinarySkinTheme theme, Color accent)

Makes a built-in skin in the given accent colour.

Parameters
theme
The built-in skin.
accent
The accent. Any colour will do; its alpha is ignored. Where it is drawn as text or as a line it is made as dark or as light as it must be to read.
Returns

A new skin, free to change, named "Fluent" and the theme ("Fluent Dark Gray" for BinarySkinTheme.DarkGray), with BinarySkin.BasedOn set to theme.

Exceptions
ArgumentOutOfRangeException
theme is not a built-in skin.

Resolve static

public static BinarySkinTheme Resolve(BinarySkinTheme theme)

Gets the theme a built-in skin is drawn as: BinarySkinTheme.System becomes BinarySkinTheme.White or BinarySkinTheme.Black as Windows is set now; any other theme is itself.

Parameters
theme
The built-in skin.
Returns

The theme it is drawn as.

Exceptions
ArgumentOutOfRangeException
theme is not a built-in skin.

Fields

DefaultAccent static

public static readonly Color DefaultAccent

The accent used when neither the application nor Windows supplies one: a mid blue, #0F6CBD.