RibbonCheckBox Class
A checkbox within a RibbonControl.
Namespace: DevExpress.WinUI.Ribbon
Assembly: DevExpress.WinUI.Ribbon.v23.2.dll
NuGet Package: DevExpress.WinUI
Declaration
[ContentProperty(Name = "Text")]
public class RibbonCheckBox :
RibbonItem<RibbonCheckBoxStyleSettings>,
ISupportToolTip
Remarks
Use the IsChecked property to specify a checkbox’s state.
The following code sample displays the RibbonCheckBox that is shown in the image above:
<Window ...
xmlns:dxr="using:DevExpress.WinUI.Ribbon">
<Grid>
<dxr:RibbonControl>
<dxr:RibbonControl.Tabs>
<dxr:RibbonTab Caption="View">
<dxr:RibbonGroup Caption="Layout">
<dxr:RibbonCheckBox Text="Rulers"/>
</dxr:RibbonGroup>
</dxr:RibbonTab>
</dxr:RibbonControl.Tabs>
</dxr:RibbonControl>
</Grid>
</Window>
Enable Indeterminate State
Set the IsThreeState property to true
to allow users to set the indeterminate state. In this case, users can change the state in the following order: Checked -> Indeterminate -> Unchecked -> Checked, and so on.
The following sample creates a ribbon checkbox with the indeterminate state:
<Window ...
xmlns:dxr="using:DevExpress.WinUI.Ribbon">
<Grid>
<dxr:RibbonControl>
<dxr:RibbonControl.Tabs>
<dxr:RibbonTab Caption="View">
<dxr:RibbonGroup Caption="Layout">
<dxr:RibbonCheckBox Text="Rulers" IsThreeState="True"/>
</dxr:RibbonGroup>
</dxr:RibbonTab>
</dxr:RibbonControl.Tabs>
</dxr:RibbonControl>
</Grid>
</Window>
Bind a RibbonCheckBox to a ViewModel Property
Customize Appearance
You can use the following properties to customize the RibbonCheckBox appearance:
Property | Description |
---|---|
CheckedDisabledTextForeground | Gets or sets a RibbonCheckBox text’s disabled state background when the checkbox is checked. This is a dependency property. |
CheckedBackground | Gets or sets a RibbonCheckBox‘s checked state background. This is a dependency property. |
CheckedBorderBrush | Gets or sets a RibbonCheckBox‘s checked state border brush. This is a dependency property. |
CheckedDisabledBackground | Gets or sets a RibbonCheckBox‘s disabled state background when the checkbox is checked. This is a dependency property. |
CheckedDisabledBorderBrush | Gets or sets a RibbonCheckBox‘s disabled state border brush when the checkbox is checked. This is a dependency property. |
CheckedDisabledForeground | Gets or sets a RibbonCheckBox‘s disabled state foreground when the checkbox is checked. This is a dependency property. |
CheckedHoverBackground | Gets or sets a RibbonCheckBox‘s hovered state background when the checkbox is checked. This is a dependency property. |
CheckedHoverBorderBrush | Gets or sets a RibbonCheckBox‘s hovered state border brush when the checkbox is checked. This is a dependency property. |
CheckedHoverForeground | Gets or sets a RibbonCheckBox‘s hovered state foreground when the checkbox is checked. This is a dependency property. |
CheckedPressedBackground | Gets or sets a RibbonCheckBox‘s pressed state background when the checkbox is checked. This is a dependency property. |
CheckedPressedBorderBrush | Gets or sets a RibbonCheckBox‘s hovered state border brush when the checkbox is checked. This is a dependency property. |
CheckedPressedForeground | Gets or sets a RibbonCheckBox‘s pressed state foreground when the checkbox is checked. This is a dependency property. |
CornerRadius | Gets or sets a corner radius of the RibbonCheckBox‘s border. This is a dependency property. |
DisabledBackground | Gets or sets a RibbonCheckBox‘s disabled state background. This is a dependency property. |
DisabledBorderBrush | Gets or sets a RibbonCheckBox‘s disabled state border brush. This is a dependency property. |
DisabledTextForeground | Gets or sets a RibbonCheckBox text’s disabled state foreground. This is a dependency property. |
HoverBackground | Gets or sets a RibbonCheckBox‘s hovered state background. This is a dependency property. |
HoverBorderBrush | Gets or sets a RibbonCheckBox‘s hovered state border brush. This is a dependency property. |
HoverTextForeground | Gets or sets a RibbonCheckBox text’s hovered state foreground. This is a dependency property. |
NormalBackground | Gets or sets a RibbonCheckBox‘s normal state background. This is a dependency property. |
NormalBorderBrush | Gets or sets a RibbonCheckBox‘s normal state border brush. This is a dependency property. |
NormalTextForeground | Gets or sets a RibbonCheckBox text’s normal state foreground. This is a dependency property. |
PressedBackground | Gets or sets a RibbonCheckBox‘s pressed state background. This is a dependency property. |
PressedBorderBrush | Gets or sets a RibbonCheckBox‘s pressed state border brush. This is a dependency property. |
PressedTextForeground | Gets or sets a RibbonCheckBox text’s pressed state foreground. This is a dependency property. |
ToolTip
You can use the following properties to display a RibbonCheckBox‘s tooltip:
Property | Description |
---|---|
ToolTip | Gets or sets the ribbon check box’s tooltip. This is a dependency property. |
ToolTipDescription | Gets or sets the ribbon checkbox’s tooltip description text that is displayed under the ToolTipTitle. This is a dependency property. |
ToolTipTitle | Gets or sets the ribbon checkbox’s tooltip title text. This is a dependency property. |