BinarySkin
A skin: the colours controls are drawn in, each named for the place it is used, with the corner rounding and window effects that go with them.
public sealed class BinarySkin
Remarks
Start from a built-in skin with Create(BinarySkinTheme, Color), change what should differ, and put it in force with Apply. A skin can also be read from a file with Load(string). Validate reports any text that would be hard to read and any state change a user could not see, so a skin can be checked before it is shipped.
Members at a glance
BasedOn | Gets or sets the built-in skin this one was made from, which a skin file records so that it can be read back the same way. |
CornerRadius | Gets or sets how far the corners of buttons, menus and panels are rounded. |
IsDark | Gets or sets whether the skin is a dark one, so that Windows draws the window frame and backdrop dark to match. |
Item | Gets or sets one of the skin's colours. |
Name | Gets or sets the name shown for the skin. |
PrefersSystemBackdrop | Gets or sets whether a window that can show the Windows backdrop (Mica, on Windows 11) behind its title should do so rather than fill it with Canvas. |
Roles | Gets every colour a skin has, in the order a skin file lists them. |
Clone | Makes an independent copy, to change without changing this one. |
CreateBrush | A frozen brush in one of the skin's colours. |
CreateBrush | A frozen brush in a colour, for a control making its own colours from a skin's. |
LooksTheSameAs | Whether another skin draws exactly as this one does: the same colours, rounding and effects. The names need not match. |
ToString | The skin's name. |
Validate | Checks that every piece of text in the skin reads on what it is drawn on, and that a user can see a command change under the pointer and when pressed. |
MaximumCornerRadius | The largest corner rounding a skin may ask for. |
Properties
BasedOn
Gets or sets the built-in skin this one was made from, which a skin file records so that it can be read back the same way.
Value. The built-in skin, or null when it was made from nothing.
CornerRadius
Gets or sets how far the corners of buttons, menus and panels are rounded.
Value. From 0 (square) to MaximumCornerRadius; 4 by default.
- ArgumentOutOfRangeException
- The value is outside that range.
IsDark
Gets or sets whether the skin is a dark one, so that Windows draws the window frame and backdrop dark to match.
Value. true for a dark skin.
Item
Gets or sets one of the skin's colours.
Value. The colour.
- role
- Where the colour is used.
- ArgumentOutOfRangeException
roleis not a colour a skin has.
Name
Gets or sets the name shown for the skin.
Value. The name. Never empty.
- ArgumentException
- The value is null or white space.
PrefersSystemBackdrop
Gets or sets whether a window that can show the Windows backdrop (Mica, on Windows 11) behind its title should do so rather than fill it with Canvas.
Value. true , the default, to let the backdrop show.
Roles
Gets every colour a skin has, in the order a skin file lists them.
Value. The roles.
Methods
Clone
Makes an independent copy, to change without changing this one.
Returns. The copy.
CreateBrush
A frozen brush in one of the skin's colours.
- role
- The colour.
Returns. A new frozen brush.
CreateBrush
A frozen brush in a colour, for a control making its own colours from a skin's.
- color
- The colour.
Returns. A new frozen brush.
LooksTheSameAs
Whether another skin draws exactly as this one does: the same colours, rounding and effects. The names need not match.
- other
- The other skin.
Returns. true when nothing a user could see differs.
ToString
The skin's name.
Returns. The name.
Validate
Checks that every piece of text in the skin reads on what it is drawn on, and that a user can see a command change under the pointer and when pressed.
Returns. What is wrong; empty when nothing is.
Fields
MaximumCornerRadius
The largest corner rounding a skin may ask for.