Skip to content

CheckBox

Enis Necipoglu edited this page Jun 9, 2018 · 10 revisions

IsChecked


            <input:CheckBox Text="Consetetur eum kasd eos" IsChecked="False" />
Xamarin Forms CheckBox IsChecked
            <input:CheckBox Text="Hello World I'm Option 2" IsChecked="True" />
Xamarin Forms CheckBox IsChecked Binding This have Two-Way Binding also.
            <input:CheckBox Text="Hello World I'm Option 2" IsChecked="{Binding YourProperty}" />

You can set it from your ViewModel or it'll change your ViewModel's property when user checked.



Key


  <input:CheckBox Text="Hello I'm Option 1" Key="1" />
  <input:CheckBox Text="Hello I'm Option 2" Key="2" />

Key just a **Int32 **value to keep inside of CheckBox, You can keep Id or something else inside it.

Binding This have Two-Way Binding also.

  <input:CheckBox Text="Hello I'm Option 1" Key="{Binding YourFirstProperty}" />
  <input:CheckBox Text="Hello I'm Option 2" Key="{Binding YourSecondProperty}" />

This property is One-Way Binding property.It can't be changed at runtime by user. This is only have Source to View Binding.



BoxBackgroundColor


   <input:CheckBox BoxBackgroundColor="Aqua" IsChecked="True" Text="Option 1"/>
Xamarin Forms CheckBox Background Color

Allows to change box's background of CheckBox

Binding This have One-Way Binding also.

   <input:CheckBox BoxBackgroundColor="{Binding YourColor}" IsChecked="True" Text="Option 1"/>
   <!-- OR -->
   <!--YOU CAN USE DYNAMICRESOURCE FROM APP.XAML-->
   <input:CheckBox BoxBackgroundColor="{DynamicResource YourColor}" IsChecked="True" Text="Option 1"/>

Clone this wiki locally