Skip to main content

CheckEdit.IsChecked Property

Gets or sets whether the checkbox is checked. This is a bindable property.

Namespace: DevExpress.Maui.Editors

Assembly: DevExpress.Maui.Editors.dll

NuGet Package: DevExpress.Maui.Editors

Declaration

public bool? IsChecked { get; set; }

Property Value

Type Default Description
Nullable<Boolean> false

true if the checkbox is checked; otherwise, false.

Remarks

Use the IsChecked property to specify the check state. If this property is set to null, the editor is in the indeterminate state. To allow users to set the indeterminate state, enable the AllowIndeterminateInput option.

When the IsChecked property value changes, the CheckedChanged event raises.

Examples

The code below displays the CheckEdit in the checked, unchecked, and indeterminate states.

.NET MAUI CheckEdit

<dxe:CheckEdit Label="Automatic date and time"
               IsChecked="True"/>
<dxe:CheckEdit Label="Automatic time zone"
               IsChecked="False"/>
<dxe:CheckEdit Label="Use 24-hour format"
               AllowIndeterminateInput="True"
               IsChecked="{x:Null}"/>

The code below binds the IsChecked property to a Trigger that sets a MultilineEdit‘s TextFontAttributes property.

.NET MAUI CheckEdit - Binding

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:dxe="clr-namespace:DevExpress.Maui.Editors;assembly=DevExpress.Maui.Editors"
             x:Class="App1.MainPage">
    <Grid Margin="20,35,20,20">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <dxe:CheckEdit x:Name="boldCheckEdit"
                       Label="Bold"
                       CheckBoxColor="Red"
                       CheckedCheckBoxColor="Red"/>
        <dxe:MultilineEdit Grid.Row="1"
                           Text="Lorem ipsum dolor sit amet.">
            <dxe:MultilineEdit.Triggers>
                <DataTrigger TargetType="dxe:MultilineEdit"
                             Binding="{Binding Source={x:Reference boldCheckEdit}, Path=IsChecked}"
                             Value="true">
                    <Setter Property="TextFontAttributes" 
                            Value="Bold"/>
                </DataTrigger>
            </dxe:MultilineEdit.Triggers>
        </dxe:MultilineEdit>
    </Grid>
</ContentPage>

The code below binds the IsChecked property to a view model’s property.

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:dxe="clr-namespace:DevExpress.Maui.Editors;assembly=DevExpress.Maui.Editors"
             xmlns:local="clr-namespace:App1"
             x:Class="App1.MainPage">
    <ContentPage.BindingContext>
        <local:CheckEditViewModel/>
    </ContentPage.BindingContext>
    <StackLayout>
        <dxe:CheckEdit x:Name="boldCheckEdit"
                       Label="Bold"
                       CheckBoxColor="Red"
                       CheckedCheckBoxColor="Red"
                       IsChecked="{Binding IsChecked}"/>
    </StackLayout>
</ContentPage>
See Also