Category / Section
How to create a Xamarin.Forms CheckBox?
1 min read
This article shows how to add a CheckBox to the Xamarin.Forms application.
Step 1: Install the Syncfusion.Xamarin.Buttons nuget as specified in the guidelines below.
https://help.syncfusion.com/xamarin/checkbox/getting-started#adding-sfcheckbox-reference
Step 2: Include a namespace to access the CheckBox in your application.
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:buttons="clr-namespace:Syncfusion.XForms.Buttons;assembly=Syncfusion.Buttons.XForms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:GettingStarted" x:Class=" GettingStarted.MainPage"> </ContentPage>
Step 3: Initialize the Xamarin CheckBox in XAML
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:buttons="clr-namespace:Syncfusion.XForms.Buttons;assembly=Syncfusion.Buttons.XForms" ……… > <StackLayout> <buttons:SfCheckBox Text="Checked"/> </StackLayout> </ContentPage>
Step 4: The following code snippet describes how to change the state of the CheckBox.
<buttons:SfCheckBox Text=" Checked" IsChecked="True"/>
Output with various state change:
See Also:
Customize the appearance of Xamarin CheckBox
How to change the intermediate state in Xamarin CheckBox
How to add collection of Xamarin CheckBox