Skip to main content

CheckEdit.IsChecked Property

Gets or sets whether the checkbox is checked.

Namespace: DevExpress.XamarinForms.Editors

Assembly: DevExpress.XamarinForms.Editors.dll

NuGet Package: DevExpress.XamarinForms.Editors

Declaration

public bool? IsChecked { get; set; }

Property Value

Type Description
Nullable<Boolean>

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.

<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.

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:dxe="http://schemas.devexpress.com/xamarin/2014/forms/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://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:dxe="http://schemas.devexpress.com/xamarin/2014/forms/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