We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to create a Xamarin.Forms CheckBox?

Platform: Xamarin.Forms |
Control: SfCheckBox

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:

Xamarin.Forms CheckBox with various checked states.

 

See Also:

 

Customize the appearance of Xamarin CheckBox

 

How to change the intermediate state in Xamarin CheckBox

 

How to add collection of Xamarin CheckBox

 

2X faster development

The ultimate Xamarin UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile