BinarySkinManager
Holds the skin in force for the whole application, publishes it in the application's resources under BinarySkinKeys, and says when it changes.
public static class BinarySkinManager
Remarks
Binarymission controls that follow the manager redraw themselves when SkinChanged is raised; the ribbon does when its skin is RibbonSkin.Shared . A window or style of the application's own can follow it too, by referring to the keys with DynamicResource . The other Binarymission WPF controls follow it too, unless AppliesToControls is turned off. Each control's colours are theme resources, and a skin in force gives them values made from its own colours; a colour the application sets on a control itself, or on the control's resource key in its own resources, always wins. Call it from the thread the application's windows run on.
Members at a glance
AppliesToControls | Gets or sets whether the Binarymission controls other than the ribbon take their colours from the skin in force. |
Current | Gets a copy of the skin in force. |
Density | Gets or sets how closely controls that follow the manager pack their commands. |
HasSkin | Gets whether a skin is in force. |
IsDark | Gets whether the skin in force is a dark one. |
Apply | Puts a skin in force: publishes it in the application's resources and raises SkinChanged. |
Clear | Takes the skin in force away: removes it from the application's resources and raises SkinChanged. |
CreateResources | The resources a skin is published as: each colour as a frozen brush and as a colour, the corner rounding, the density and whether it is dark. |
RegisterControlResources | Registers the way a control's colours are made from a skin. Called once by each Binarymission control type that follows the skin; an application's own control can use it the same way. |
SkinChanged | Raised after Current or Density changes and the new values are in the application's resources. |
Properties
AppliesToControls
Gets or sets whether the Binarymission controls other than the ribbon take their colours from the skin in force.
Value. true , the default. When false they keep their own default colours whatever skin is in force; BinarySkinKeys is published either way.
Current
Gets a copy of the skin in force.
Value. The skin, or null when none has been applied.
Apply.Density
Gets or sets how closely controls that follow the manager pack their commands.
Value. Standard by default.
HasSkin
Gets whether a skin is in force.
Value. true after Apply and until Clear.
IsDark
Gets whether the skin in force is a dark one.
Value. false when no skin is in force.
Methods
Apply
Puts a skin in force: publishes it in the application's resources and raises SkinChanged.
- skin
- The skin. It is copied, so changing it afterwards changes nothing until it is applied again.
- ArgumentNullException
skinis null .
Clear
Takes the skin in force away: removes it from the application's resources and raises SkinChanged.
CreateResources
The resources a skin is published as: each colour as a frozen brush and as a colour, the corner rounding, the density and whether it is dark.
- skin
- The skin.
Returns. A new dictionary.
RegisterControlResources
Registers the way a control's colours are made from a skin. Called once by each Binarymission control type that follows the skin; an application's own control can use it the same way.
- create
- Makes the control's theme resources from a skin: a new dictionary, keyed by the same keys the control's default style refers to with DynamicResource .
- ArgumentNullException
createis null .
Events
SkinChanged
Raised after Current or Density changes and the new values are in the application's resources.