Checkboxes are controls that can be clicked, which then executes a command or raises an event.
Note
This topic extends the Control Basics topic with additional information specific to the control types described below. Please refer to the base topic for more generalized concepts that apply to all controls, including this one.
Control Implementations
There are separate checkbox concept control implementations based on the usage context.
Ribbon and Toolbar Contexts
Use the Bar
A BarCheckBox example
Specification | Details |
---|---|
Base class | BarButton . |
Has key | Yes, via the Key property. |
Has label | Yes, via the Label property. Auto-generated from the Key value if not specified. |
Has image | No. |
Has popup | No. |
Is checkable | Yes. |
Variant sizes | None. |
Command support | Yes, via the Command property. |
Key tip support | Yes, via the KeyLabel value if not specified. |
Ribbon QAT support | Yes, via the Can |
UI density support | None. |
MVVM Library VM | Bar |
Menu Contexts
Use the Bar
A checkable BarMenuItem example in checked state
Specification | Details |
---|---|
Base class | Native MenuItem . |
Has key | Yes, via the Key property. |
Has label | Yes, via the Label property. Auto-generated from the Key value if not specified. |
Has image | Yes, via the Small |
Has popup | Not when a checkbox concept is desired. |
Is checkable | Yes, when the IsCheckable property is set to true . |
Variant sizes | None, but has a Use |
Command support | Yes, via the Command property. |
Key tip support | Yes, via the KeyLabel value if not specified. |
Ribbon QAT support | Yes, via the Can |
UI density support | None. |
MVVM Library VM | Bar |
Appearance
There are several appearance-related properties that determine how the controls render.
Label
The controls have a string Label
that can be set, which is visible in UI.
The Label
can be auto-generated based on the control's Key
property. For instance, a control with Key
of "FormatPainter"
will automatically assign "Format Painter"
as the Label
value. The auto-generated default can be overridden by setting the Label
property.
The Bar
The Bar
Images
Bar
Bar
Description (BarMenuItem only)
When Use
Title
An optional string BarLabel
when displayed in screen tips and customization UI.
Variant Sizes
Bar
While Bar
Checked State
The controls support a checked state.
Set the BarIsChecked
property to true
to render the control in a checked state.
Key Tips
The controls support key tips. When a control's key tip is accessed, a click is simulated.
The KeyTipText
can be auto-generated based on the control's Label
property. For instance, a control with Label
of "Copy"
will automatically assign "C"
as the KeyTipText
value. The auto-generated default can be overridden by setting the KeyTipText
property.
The Bar
See the Key Tips topic for more information on key tips.
Commands and Events
The ICommand
in the BarCommand
and BarCommand
properties is executed when the control is clicked or a key tip accesses the control.
A BarClick
and BarClick
event is also raised in these scenarios.
See the Using Commands topic for more information on commands.
Input Gesture Text
The control can have input gesture text associated with it that describes a related keyboard shortcut, and is displayed in the screen tip for the control or in the menu item itself.
This input gesture text is automatically derived from commands that inherit RoutedCommand
and have a KeyGesture
set.
Or input gesture text can be specified in the BarInputGestureText
properties.
Input gesture text may be hidden altogether in UI by setting the Barfalse
.
Screen Tips
The controls support screen tips, which are formatted tool tips.
The control's Title
is used as the default screen tip header, falling back to Label
if no Title
is available. The Bar
If the control's ToolTip
property is set to a value that doesn't derive from a native ToolTip
control, such as a string, the value will be used in the screen tip's content area, with the screen tip header becoming bold. The screen tip's content area is where extended descriptions are displayed.
If the optional Bar
See the Screen Tips topic for more information on screen tips.
MVVM Support
The optional companion MVVM Library defines a Bar
This view model class maps over to the appropriate view controls described above based on usage context and configures all necessary bindings between the view model and the view control.
Tip
See the MVVM Support topic for more information on how to use the library's view models and view templates to create and manage your application's bars controls with MVVM techniques.