HypernovaDesktop Components · docs
Binarymission
WPF › Ribbon › BinaryRibbonBuiltInSkinController

BinaryRibbonBuiltInSkinController

class.NET 6 / 8 / 10.NET Framework 4.8Binarymission.WPF.Controls.Office

A class that helps in switching between various built-in ribbon skins.

public static partial class BinaryRibbonBuiltInSkinController

Members at a glance

AccentColorGets or sets the accent colour the Fluent skins use for the application menu button, the selected tab and the other places Office puts its application colour.
EffectiveAccentColorGets the accent colour the Fluent skins are drawing with now.
IsWindowsInDarkModeGets whether Windows is set to dark mode for applications.
OfficeBlackGets the office2007 Black skin.
OfficeBlueGets the office2007 Blue skin.
OfficeSilverGets the office2007 Silver skin.
SkinGets or sets the RibbonSkin.
Windows7Gets the Windows7 skin.
ContrastRatioThe WCAG contrast ratio between two colours, from 1 (none) to 21 (black on white).
RefreshSystemAppearanceApplies the Windows appearance again if a skin that follows it is in force.
SkinChangedOccurs after a skin has been applied - when Skin is set, when a Fluent skin is rebuilt because the accent colour or the Windows light or dark setting changed, and when Shared follows a new skin in the skin manager.

Properties

AccentColor

public static Color? AccentColor

Gets or sets the accent colour the Fluent skins use for the application menu button, the selected tab and the other places Office puts its application colour.

Value. The accent, or null - the default - to take the one the user chose in Windows.

Setting it while a Fluent skin is in force applies it at once. Text drawn in the accent is darkened or lightened as far as it needs to be to stay readable on the theme's surfaces, so any colour can be given here.

EffectiveAccentColor

public static Color EffectiveAccentColor

Gets the accent colour the Fluent skins are drawing with now.

Value. AccentColor when the application has set one; otherwise the Windows accent; otherwise a Fluent blue.

IsWindowsInDarkMode

public static bool IsWindowsInDarkMode

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).

OfficeBlack

public static ResourceDictionary OfficeBlack

Gets the office2007 Black skin.

OfficeBlue

public static ResourceDictionary OfficeBlue

Gets the office2007 Blue skin.

OfficeSilver

public static ResourceDictionary OfficeSilver

Gets the office2007 Silver skin.

Skin

public static RibbonSkin Skin

Gets or sets the RibbonSkin.

Windows7

public static ResourceDictionary Windows7

Gets the Windows7 skin.

Methods

ContrastRatio

public static double ContrastRatio(Color a, Color b)

The WCAG contrast ratio between two colours, from 1 (none) to 21 (black on white).

a
One colour.
b
The other.

Returns. The ratio; Ratio gives the same.

RefreshSystemAppearance

public static void RefreshSystemAppearance()

Applies the Windows appearance again if a skin that follows it is in force.

BinaryRibbonWindow calls this itself when Windows reports that the theme or the accent has changed. An application whose ribbon is not in one calls it from its own handling of WM_SETTINGCHANGE .

Events

SkinChanged

public static event EventHandler SkinChanged

Occurs after a skin has been applied - when Skin is set, when a Fluent skin is rebuilt because the accent colour or the Windows light or dark setting changed, and when Shared follows a new skin in the skin manager.

For an application that draws pictures of its own in the ribbon's colours - a glyph drawn in code, say - and has to draw them again when those colours change.