-
Notifications
You must be signed in to change notification settings - Fork 3
CheckBox
Back to home | Back to Reference | View raw text
A CheckBox control with more customization over the appearance, and a larger box for a more touch-friendly UI.
flowchart LR
classDef interfaceStyle stroke-dasharray: 5 5;
classDef abstractStyle stroke-width:4px
subgraph SolidShineUi
SolidShineUi.CheckBox[[CheckBox]]
end
subgraph System.Windows.Controls
System.Windows.Controls.ContentControl[[ContentControl]]
end
System.Windows.Controls.ContentControl --> SolidShineUi.CheckBox
Type | Name | Methods |
---|---|---|
Brush |
BackgroundDisabledBrush Get or set the brush to use for the background of the checkbox's box when it is disabled. |
get, set |
Brush |
BorderBrush Get or set the brush used for the border of the checkbox's box. |
get, set |
Brush |
BorderDisabledBrush Get or set the brush used for the border of the checkbox's box when it is disabled. |
get, set |
Brush |
BorderHighlightBrush Get or set the brush used for the border of the checkbox's box, while the mouse is over the control or it has keyboard focus. |
get, set |
Thickness |
BorderSelectionThickness Get or set the thickness of the border of the check box, while the check box's IsChecked property is true. |
get, set |
Thickness |
BorderThickness Get or set the thickness of the border of the check box. |
get, set |
Brush |
CheckBackground Get or set the brush used for the background of the checkbox's box. This is not set via a color scheme. |
get, set |
Brush |
CheckDisabledBrush Get or set the brush used for the check mark when the control is disabled. |
get, set |
Brush |
CheckForeground Get or set the brush used for the check mark in the checkbox's box. |
get, set |
CheckState |
CheckState Get or set the state of the checkbox, via a CheckState enum. Can be set via this property or via the IsChecked and IsIndeterminate properties. |
get, set |
bool |
ClickOnPress Gets or sets whether the Click event should be raised when the checkbox is pressed, rather than when it is released. |
get, set |
ColorScheme |
ColorScheme Get or set the color scheme used for this checkbox. For easier color scheme management, bind this to the window or larger control you're using. |
get, set |
CornerRadius |
CornerRadius Get or set the corner radius of the check box. |
get, set |
bool |
IsChecked Get or set if the check box is checked. (Note: if in the Indeterminate state, it will still return true as checked.) |
get, set |
bool |
IsIndeterminate Get or set if the check box is in the Indeterminate state. |
get, set |
bool |
OnlyAllowCheckBoxClick Gets or sets whether clicking should only occur when the checkbox's box is clicked, and not the rest of the control. |
get, set |
bool |
TriStateClick Gets or sets whether the checkbox should cycle through three states (rather than two) when clicked. The third state is the "Indeterminate" state, which can be checked via the IsIndeterminate property. |
get, set |
Returns | Name |
---|---|
void |
OnColorSchemeChanged (DependencyObject d, DependencyPropertyChangedEventArgs e)Perform an action when the ColorScheme property has changed. Primarily used internally. |
Returns | Name |
---|---|
void |
ApplyColorScheme (ColorScheme cs)Apply a color scheme to this control. The color scheme can quickly apply a whole visual style to the control. |
void |
DoClick ()Perform a click programattically. The checkbox responds the same way as if it was clicked by the user. |
A CheckBox control with more customization over the appearance, and a larger box for a more touch-friendly UI.
ContentControl
public CheckBox()
Create a new CheckBox control.
public static void OnColorSchemeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
Type | Name | Description |
---|---|---|
DependencyObject |
d | The object containing the property that changed. |
DependencyPropertyChangedEventArgs |
e | Event arguments about the property change. |
Perform an action when the ColorScheme property has changed. Primarily used internally.
public void ApplyColorScheme(ColorScheme cs)
Type | Name | Description |
---|---|---|
ColorScheme |
cs | The color scheme to apply. |
Apply a color scheme to this control. The color scheme can quickly apply a whole visual style to the control.
public void DoClick()
Perform a click programattically. The checkbox responds the same way as if it was clicked by the user.
public bool IsChecked { get; set; }
Get or set if the check box is checked. (Note: if in the Indeterminate state, it will still return true as checked.)
public bool IsIndeterminate { get; set; }
Get or set if the check box is in the Indeterminate state.
public CheckState CheckState { get; set; }
Get or set the state of the checkbox, via a CheckState enum. Can be set via this property or via the IsChecked and IsIndeterminate properties.
public ColorScheme ColorScheme { get; set; }
Get or set the color scheme used for this checkbox. For easier color scheme management, bind this to the window or larger control you're using.
public Brush CheckBackground { get; set; }
Get or set the brush used for the background of the checkbox's box. This is not set via a color scheme.
public Brush CheckForeground { get; set; }
Get or set the brush used for the check mark in the checkbox's box.
public Brush BackgroundDisabledBrush { get; set; }
Get or set the brush to use for the background of the checkbox's box when it is disabled.
public Brush BorderDisabledBrush { get; set; }
Get or set the brush used for the border of the checkbox's box when it is disabled.
public Brush CheckDisabledBrush { get; set; }
Get or set the brush used for the check mark when the control is disabled.
public Brush BorderBrush { get; set; }
Get or set the brush used for the border of the checkbox's box.
public Brush BorderHighlightBrush { get; set; }
Get or set the brush used for the border of the checkbox's box, while the mouse is over the control or it has keyboard focus.
public Thickness BorderThickness { get; set; }
Get or set the thickness of the border of the check box.
public Thickness BorderSelectionThickness { get; set; }
Get or set the thickness of the border of the check box, while the check box's IsChecked property is true.
public CornerRadius CornerRadius { get; set; }
Get or set the corner radius of the check box.
public bool ClickOnPress { get; set; }
Gets or sets whether the Click event should be raised when the checkbox is pressed, rather than when it is released.
public bool TriStateClick { get; set; }
Gets or sets whether the checkbox should cycle through three states (rather than two) when clicked. The third state is the "Indeterminate" state, which can be checked via the IsIndeterminate property.
public bool OnlyAllowCheckBoxClick { get; set; }
Gets or sets whether clicking should only occur when the checkbox's box is clicked, and not the rest of the control.
public event RoutedEventHandler CheckBoxClick
An event that raises only when the checkbox itself is clicked.
public event RoutedEventHandler CheckChanged
Raised when the CheckState property is changed, either to Checked, Indeterminate, or Unchecked.
public event RoutedEventHandler Checked
Raised when the CheckState property is changed to Checked.
public event RoutedEventHandler Unchecked
Raised when the CheckState property is changed to Unchecked.
public event RoutedEventHandler Indeterminate
Raised when the CheckState property is changed to Indeterminate.
protected event DependencyPropertyChangedEventHandler InternalIsCheckedChanged
Internal event for handling a property changed. Please view the event that is not prefixed as "Internal".
protected event DependencyPropertyChangedEventHandler InternalIsIndeterminateChanged
Internal event for handling a property changed. Please view the event that is not prefixed as "Internal".
public event DependencyPropertyChangedEventHandler ColorSchemeChanged
Raised when the ColorScheme property is changed.
public event RoutedEventHandler Click
Raised when the check box is clicked.
public event RoutedEventHandler RightClick
Raised when the check box is right-clicked.
Generated with ModularDoc