BinaryCheckBox
A check box whose box, border and check mark can each be coloured for every state – normal, pointer over, pressed and disabled – without writing a template.
public class BinaryCheckBox : CheckBox
Inherits from / implements: CheckBox
Remarks
It is an ordinary CheckBox in every other way: bind
IsChecked, set
IsThreeState, and so on. It sits
well in a tree list view cell.
Examples
<GridViewColumn Header="Done" Width="60">
<GridViewColumn.CellTemplate>
<DataTemplate>
<tlv:BinaryCheckBox IsChecked="{Binding IsComplete}"
CornerRadius="3"
NormalBorderBrush="#9AA7B8"
CheckMarkGlyphBrush="#1F77D0" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>Members at a glance
| Properties | |
|---|---|
CheckMarkGlyphBrush | Gets or sets the colour of the check mark. |
CheckMarkHeight | Gets or sets the height of the check mark. |
CheckMarkWidth | Gets or sets the width of the check mark. |
CornerRadius | Gets or sets how much the corners of the box are rounded. |
DisabledBackgroundBrush | Gets or sets the fill of the box while the check box is disabled. |
DisabledBorderBrush | Gets or sets the colour of the box's border while the check box is disabled. |
DisabledForegroundBrush | Gets or sets the colour of the check box's text while it is disabled. |
DisabledGlyphBrush | Gets or sets the colour of the check mark while the check box is disabled. |
MouseOverBrush | Gets or sets the fill of the box while the pointer is over it. |
NormalBorderBrush | Gets or sets the colour of the box's border. |
NormalBrush | Gets or sets the fill of the box when the pointer is not over it. |
PressedBorderBrush | Gets or sets the colour of the box's border while it is being pressed. |
PressedBrush | Gets or sets the fill of the box while it is being pressed. |
| Methods | |
OnApplyTemplate | Finds the check mark in the template once it has been applied, and draws it at
CheckMarkWidth by CheckMarkHeight. |
| Fields | |
CheckMarkGlyphBrushProperty | Identifies the CheckMarkGlyphBrush dependency property. |
CheckMarkHeightProperty | Identifies the CheckMarkHeight dependency property. |
CheckMarkWidthProperty | Identifies the CheckMarkWidth dependency property. |
CornerRadiusProperty | Identifies the CornerRadius dependency property. |
DisabledBackgroundBrushProperty | Identifies the DisabledBackgroundBrush dependency property. |
DisabledBorderBrushProperty | Identifies the DisabledBorderBrush dependency property. |
DisabledForegroundBrushProperty | Identifies the DisabledForegroundBrush dependency property. |
DisabledGlyphBrushProperty | Identifies the DisabledGlyphBrush dependency property. |
MouseOverBrushProperty | Identifies the MouseOverBrush dependency property. |
NormalBorderBrushProperty | Identifies the NormalBorderBrush dependency property. |
NormalBrushProperty | Identifies the NormalBrush dependency property. |
PressedBorderBrushProperty | Identifies the PressedBorderBrush dependency property. |
PressedBrushProperty | Identifies the PressedBrush dependency property. |
Properties
CheckMarkGlyphBrush
Gets or sets the colour of the check mark.
CheckMarkHeight
Gets or sets the height of the check mark.
- Value
- The height in device-independent units (1/96 inch). The control's style sets 15.
CheckMarkWidth
Gets or sets the width of the check mark.
- Value
- The width in device-independent units (1/96 inch). The control's style sets 15.
CornerRadius
Gets or sets how much the corners of the box are rounded.
- Value
- The default is no rounding.
DisabledBackgroundBrush
Gets or sets the fill of the box while the check box is disabled.
DisabledBorderBrush
Gets or sets the colour of the box's border while the check box is disabled.
DisabledForegroundBrush
Gets or sets the colour of the check box's text while it is disabled.
DisabledGlyphBrush
Gets or sets the colour of the check mark while the check box is disabled.
MouseOverBrush
Gets or sets the fill of the box while the pointer is over it.
NormalBorderBrush
Gets or sets the colour of the box's border.
NormalBrush
Gets or sets the fill of the box when the pointer is not over it.
PressedBorderBrush
Gets or sets the colour of the box's border while it is being pressed.
PressedBrush
Gets or sets the fill of the box while it is being pressed.
Methods
OnApplyTemplate
Finds the check mark in the template once it has been applied, and draws it at
CheckMarkWidth by CheckMarkHeight.
Remarks
A derived class that overrides this should call the base implementation.
Fields
CheckMarkGlyphBrushProperty static
Identifies the CheckMarkGlyphBrush dependency property.
CheckMarkHeightProperty static
Identifies the CheckMarkHeight dependency property.
CheckMarkWidthProperty static
Identifies the CheckMarkWidth dependency property.
CornerRadiusProperty static
Identifies the CornerRadius dependency property.
DisabledBackgroundBrushProperty static
Identifies the DisabledBackgroundBrush dependency property.
DisabledBorderBrushProperty static
Identifies the DisabledBorderBrush dependency property.
DisabledForegroundBrushProperty static
Identifies the DisabledForegroundBrush dependency property.
DisabledGlyphBrushProperty static
Identifies the DisabledGlyphBrush dependency property.
MouseOverBrushProperty static
Identifies the MouseOverBrush dependency property.
NormalBorderBrushProperty static
Identifies the NormalBorderBrush dependency property.
NormalBrushProperty static
Identifies the NormalBrush dependency property.
PressedBorderBrushProperty static
Identifies the PressedBorderBrush dependency property.
PressedBrushProperty static
Identifies the PressedBrush dependency property.