Back to Devexpress

BarCheckItem.IsChecked Property

wpf-devexpress-dot-xpf-dot-bars-dot-barcheckitem-4ea98ce4.md

latest7.0 KB
Original Source

BarCheckItem.IsChecked Property

Gets or sets whether the item is in the pushed state. This is a dependency property.

Namespace : DevExpress.Xpf.Bars

Assembly : DevExpress.Xpf.Core.v25.2.dll

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public bool? IsChecked { get; set; }
vb
Public Property IsChecked As Boolean?

Property Value

TypeDescription
Nullable<Boolean>

true if the item is in the pushed state; otherwise, false.

|

Remarks

Use the IsChecked property to specify the item’s check state. By default, a bar check item has two states - Checked and Unchecked. If the BarCheckItem.IsThreeState option is enabled, the item supports three states: Checked, Unchecked and Indeterminate.

Changing the IsChecked property fires the BarCheckItem.CheckedChanged event.

The following code snippets (auto-collected from DevExpress Examples) contain references to the IsChecked property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

mvvm-application-with-wpf-bars/CS/Bars_in_MVVM_Application/MainWindow.xaml#L44

xml
<dxb:BarCheckItem x:Name="completed" Content="Completed"
                  IsChecked="{Binding SelectedIssue.Completed}"
                  IsEnabled="{DXBinding 'SelectedIssue != null'}"

wpf-dock-layout-manager-define-prism-regions-for-dock-layout-manager-elements/CS/PrismOnDXDocking/Shell.xaml#L26

xml
<dxb:BarSubItem Name="bsFile" Content="File"/>
<dxb:BarCheckItem Name="bMDIStyle" CategoryName="Window" Content="Use Tabbed MDI" IsThreeState="False" IsChecked="False"
                   Command="dxdo:MDIControllerCommand.ChangeMDIStyle"

wpf-docklayoutmanager-merge-ribbon-controls/CS/WpfApplication1/MainWindow.xaml#L32

xml
<dxr:RibbonStatusBarControl.RightItems>
    <dxb:BarCheckItem x:Name="biLeft" Glyph="{dx:DXImage Image=AlignLeft_16x16.png}" GroupIndex="1" IsChecked="True" MergeType="MergeItems"/>
    <dxb:BarCheckItem x:Name="biCenter" Glyph="{dx:DXImage Image=AlignCenter_16x16.png}" GroupIndex="1" MergeType="MergeItems"/>

wpf-pivot-grid-create-context-menu-for-field-values/CS/WpfPivotGrid_CustomMenu/MainWindow.xaml#L20

xml
<dxb:BarCheckItem Name="ShowColumnGrandTotals"
              IsChecked="{Binding ElementName=pivotGrid, Path=ShowColumnGrandTotals, Mode=TwoWay}"
              Content="Show Column Grand Totals" />

wpf-scheduler-apply-end-user-restrictions/CS/WpfApplication1/MainWindow.xaml.cs#L16

csharp
private void customAllowAppointmentCreateHandler(object sender, AppointmentItemOperationEventArgs e) {
    if((bool)barItemDisableCreatingAppointments.IsChecked) {
        // If the "Disable Creating Appointments" bar item is checked, do not allow appointment creation

wpf-pivot-grid-show-top-n-values-in-context-menu/CS/ContextMenuToShowTopN_Example/MainWindow.xaml.cs#L57

csharp
if (IsTopFiveValuesApplied(valueItem))
    item.IsChecked = true;
item.CheckedChanged += Item_CheckedChanged;

wpf-scheduler-customize-context-menus/CS/DXScheduler_PopUpMenuCustomization/MainWindow.xaml.cs#L13

csharp
AppointmentItem selectedItem = scheduler.SelectedAppointments[0];
    selectedItem.AllDay = (allDayCheck.IsChecked == true) ? true : false;
}

wpf-pivot-grid-change-summary-display-type/CS/HeaderMenuCustomizationExample/HeaderMenuHelper.cs#L81

csharp
checkItem.Content = enumValue.ToString();
checkItem.IsChecked = Object.Equals(field.Tag, enumValue)||
    enumValue.Equals(FieldSummaryDisplayType.Default) && field.Tag == null;

wpf-pivot-grid-show-top-n-values-in-context-menu/VB/ContextMenuToShowTopN_Example/MainWindow.xaml.vb#L54

vb
If IsTopFiveValuesApplied(valueItem) Then
    item.IsChecked = True
End If

wpf-pivot-grid-change-summary-display-type/VB/HeaderMenuCustomizationExample/HeaderMenuHelper.vb#L80

vb
checkItem.Content = enumValue.ToString()
checkItem.IsChecked = Object.Equals(field.Tag, enumValue) OrElse enumValue.Equals(FieldSummaryDisplayType.Default) AndAlso field.Tag Is Nothing
checkItem.Tag = New Object() {field, [property], enumValue}

See Also

CheckedChanged

IsThreeState

BarCheckItem Class

BarCheckItem Members

DevExpress.Xpf.Bars Namespace