Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions xamarin-android/SfCheckBox/Event.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
---
layout: post
title: Event | SfCheckBox | Syncfusion® | Xamarin.Android
description: Learn how to get the notification of StateChanged event in Xamarin.Android CheckBox(SfCheckBox) control
platform: Xamarin.Android
description: Learn how to get the notification of StateChanged event in Xamarin.Android CheckBox (SfCheckBox) control
platform: xamarin.android
control: SfCheckBox
documentation: ug
keywords: button, SfCheckBox, CheckBox

---

# Event in Xamarin.Android Chart(SfChart)
# Event in Xamarin.Android CheckBox (SfCheckBox)

## StateChanged event
Occurs when the value(state) of the [`Checked`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html#Syncfusion_Android_Buttons_SfCheckBox_Checked) property is changed by either touching the check box or setting the value to the [`Checked`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html#Syncfusion_Android_Buttons_SfCheckBox_Checked) property using C# code. The event arguments are of type [`StateChangedEventArgs`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.StateChangedEventArgs.html) and expose the following property:
## StateChanged Event
Occurs when the value (state) of the [`Checked`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html#Syncfusion_Android_Buttons_SfCheckBox_Checked) property is changed by either touching the check box or setting the value to the [`Checked`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html#Syncfusion_Android_Buttons_SfCheckBox_Checked) property using C# code. The event arguments are of type [`StateChangedEventArgs`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.StateChangedEventArgs.html) and expose the following property:

* [`IsChecked`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.StateChangedEventArgs.html#Syncfusion_Android_Buttons_StateChangedEventArgs_IsChecked): The new value(state) of the [`Checked`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html#Syncfusion_Android_Buttons_SfCheckBox_Checked) property.
* [`IsChecked`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.StateChangedEventArgs.html#Syncfusion_Android_Buttons_StateChangedEventArgs_IsChecked): The new value (state) of the [`Checked`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html#Syncfusion_Android_Buttons_SfCheckBox_Checked) property.

{% tabs %}
{% highlight c# %}
Expand Down
47 changes: 24 additions & 23 deletions xamarin-android/SfCheckBox/Getting-Started.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: post
title: Getting started in Syncfusion® CheckBox for Xamarin.Android platform
title: Getting Started with Syncfusion® CheckBox for Xamarin.Android Platform
description: Learn how to create a simple CheckBox and their customization options with the available basic features in Xamarin.Android
platform: xamarin.android
control: SfCheckBox
Expand All @@ -9,28 +9,28 @@ keywords: button, SfCheckBox, CheckBox

---

# Getting Started Xamarin.Android Checkbox (SfCheckbox)
This section explains the steps required to configure the [`SfCheckBox`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html) control in a real-time scenario and provides a walk-through on some of the customization features available in [`SfCheckBox`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html) control.
# Getting Started with Xamarin.Android CheckBox (SfCheckBox)
This section explains the steps required to configure the [`SfCheckBox`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html) control in a real-time scenario and provides a walk-through on some of the customization features available in the [`SfCheckBox`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html) control.

## Add SfCheckBox reference
Syncfusion<sup>®</sup> Xamarin components are available in [nuget.org](https://www.nuget.org/). To add checkbox to your project, open the NuGet package manager in Visual Studio, and search for "[syncfusion.xamarin.buttons.android](https://www.nuget.org/packages/Syncfusion.Xamarin.Buttons.Android)", and then install it.
## Add SfCheckBox Reference
Syncfusion<sup>®</sup> Xamarin components are available in [nuget.org](https://www.nuget.org/). To add CheckBox to your project, open the NuGet package manager in Visual Studio, search for "[Syncfusion.Xamarin.Buttons.Android](https://www.nuget.org/packages/Syncfusion.Xamarin.Buttons.Android)", and then install it.

![Xamarin.Android CheckBox NuGet](Images/nuget.png)

N>Starting with v16.2.0.x, if you reference Syncfusion<sup>®</sup> assemblies from trial setup or from the NuGet feed, you also have to include a license key in your projects. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/license-key) to know about registering Syncfusion<sup>®</sup> license key in your Xamarin application to use our components.
N> Starting with v16.2.0.x, if you reference Syncfusion<sup>®</sup> assemblies from trial setup or from the NuGet feed, you also have to include a license key in your projects. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/license-key) to know about registering Syncfusion<sup>®</sup> license key in your Xamarin application to use our components.

## Create a Simple SfCheckBox
The [`SfCheckBox`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html) control is configured entirely in C# code. The following steps explain how to create a [`SfCheckBox`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html) and configure its elements.

### Add namespace for referred assemblies
### Add Namespace for Referenced Assemblies

{% tabs %}
{% highlight c# %}
using Syncfusion.XForms.Buttons;
{% endhighlight %}
{% endtabs %}

### Refer SfCheckBox control with declared suffix name for Namespace
### Refer SfCheckBox Control with Declared Suffix Name for Namespace

{% tabs %}
{% highlight c# %}
Expand Down Expand Up @@ -58,8 +58,8 @@ namespace SfCheckBox_Sample
{% endhighlight %}
{% endtabs %}

## Setting caption
The check box caption can be defined using the `Text` property of [`SfCheckBox`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html). This caption normally describes the meaning of the check box and it displays next to check box.
## Setting Caption
The CheckBox caption can be defined using the `Text` property of [`SfCheckBox`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html). This caption normally describes the meaning of the CheckBox and displays next to the CheckBox.

{% tabs %}
{% highlight c# %}
Expand All @@ -71,7 +71,8 @@ checkBox.Text = "CheckBox";

![Xamarin.Android CheckBox caption](Images/Caption.png)

## Change the check box state
## Change the CheckBox State

The three visual states of [`SfCheckBox`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html) are:

* Checked
Expand All @@ -80,7 +81,7 @@ The three visual states of [`SfCheckBox`](https://help.syncfusion.com/cr/xamarin

![Xamarin.Android CheckBox states](Images/States.png)

You can change the state of the check box using the [`Checked`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html#Syncfusion_Android_Buttons_SfCheckBox_Checked) property of [`SfCheckBox`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html). In checked state, a tick mark is added to the visualization of check box.
You can change the state of the CheckBox using the [`Checked`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html#Syncfusion_Android_Buttons_SfCheckBox_Checked) property of [`SfCheckBox`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html). In the checked state, a tick mark is added to the visualization of the CheckBox.

<table>
<tr>
Expand All @@ -96,7 +97,7 @@ You can change the state of the check box using the [`Checked`](https://help.syn
</tr>
<tr>
<td>
checked
Checked
</td>
<td>
Checked
Expand All @@ -107,7 +108,7 @@ true
</tr>
<tr>
<td>
unchecked
Unchecked
</td>
<td>
Checked
Expand All @@ -118,7 +119,7 @@ false
</tr>
<tr>
<td>
indeterminate
Indeterminate
</td>
<td>
Checked
Expand All @@ -129,9 +130,9 @@ null
</tr>
</table>

N>For the check box, to report the indeterminate state, set the [`IsThreeState`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html#Syncfusion_Android_Buttons_SfCheckBox_IsThreeState) property to true.
N> For the CheckBox to report the indeterminate state, set the [`IsThreeState`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html#Syncfusion_Android_Buttons_SfCheckBox_IsThreeState) property to `true`.

Check box can be used as a single or as a group. A single check box mostly used for a binary yes/no choice, such as "Remember me?", login scenario, or a terms of service agreement.
CheckBox can be used as a single control or as a group. A single CheckBox is mostly used for a binary yes/no choice, such as "Remember me?", login scenario, or a terms of service agreement.

{% tabs %}
{% highlight c# %}
Expand All @@ -143,7 +144,7 @@ checkBox.Checked = true;

![Xamarin.Android CheckBox tri-state](Images/Agree.png)

Multiple check boxes can be used as a group for multi-select scenarios in which a user chooses one or more items from the group of choices that are not mutually exclusive.
Multiple CheckBoxes can be used as a group for multi-select scenarios in which a user chooses one or more items from the group of choices that are not mutually exclusive.

{% tabs %}
{% highlight c# %}
Expand All @@ -166,11 +167,11 @@ onion.Checked = true;

## Indeterminate

The [`SfCheckBox`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html) allows an indeterminate state in addition to the checked and unchecked state. The indeterminate state of the check box is enabled by setting the [`IsThreeState`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html#Syncfusion_Android_Buttons_SfCheckBox_IsThreeState) property of the control to `True`.
The [`SfCheckBox`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html) allows an indeterminate state in addition to the checked and unchecked states. The indeterminate state of the CheckBox is enabled by setting the [`IsThreeState`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html#Syncfusion_Android_Buttons_SfCheckBox_IsThreeState) property of the control to `true`.

N>When the [`IsThreeState`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html#Syncfusion_Android_Buttons_SfCheckBox_IsThreeState) property is set to `False` and [`Checked`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html#Syncfusion_Android_Buttons_SfCheckBox_Checked) property is set to `null` then the check box will be in unchecked state.
N> When the [`IsThreeState`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html#Syncfusion_Android_Buttons_SfCheckBox_IsThreeState) property is set to `false` and [`Checked`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html#Syncfusion_Android_Buttons_SfCheckBox_Checked) property is set to `null`, then the CheckBox will be in unchecked state.

The indeterminate state is used when a group of sub-choices has both checked and unchecked states. In the following example, the "Select all" checkbox has the [`IsThreeState`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html#Syncfusion_Android_Buttons_SfCheckBox_IsThreeState) property set to `true`. The "Select all" checkbox is checked if all child elements are checked, unchecked if all the child elements are unchecked, and indeterminate otherwise.
The indeterminate state is used when a group of sub-choices has both checked and unchecked states. In the following example, the "Select all" CheckBox has the [`IsThreeState`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html#Syncfusion_Android_Buttons_SfCheckBox_IsThreeState) property set to `true`. The "Select all" CheckBox is checked if all child elements are checked, unchecked if all the child elements are unchecked, and indeterminate otherwise.

{% tabs %}
{% highlight c# %}
Expand Down Expand Up @@ -222,6 +223,6 @@ private void CheckBox_StateChanged(object sender, StateChangedEventArgs e)
{% endhighlight %}
{% endtabs %}

![Xamarin.Android CheckBox intermediate state](Images/Inter1.jpg) ![](Images/Inter2.jpg)
![Xamarin.Android CheckBox intermediate state](Images/Inter1.jpg) ![Xamarin.Android CheckBox intermediate state](Images/Inter2.jpg)

This demo can be downloaded from this [link](https://github.com/SyncfusionExamples/GettingStarted-Sample-in--CheckBox-Android).
N> This demo can be downloaded from this [link](https://github.com/SyncfusionExamples/GettingStarted-Sample-in--CheckBox-Android).
16 changes: 8 additions & 8 deletions xamarin-android/SfCheckBox/Overview.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
---
layout: post
title: Overview in SfCheckBox for Xamarin.Android platform
description: Learn how to customize the basic features of SfCheckBox
platform: Xamarin.Android
title: Overview of Syncfusion® SfCheckBox for Xamarin.Android Platform
description: Learn how to customize and configure the basic features of Syncfusion SfCheckBox control for enhanced user interface in Xamarin.Android applications.
platform: xamarin.android
control: SfCheckBox
documentation: ug
keywords: button, SfCheckBox, CheckBox

---

# Overview
The check box is a selection control that allows users to select one or more options from a set. The three states of check box are checked, unchecked and indeterminate.
The CheckBox is a selection control that allows users to select one or more options from a set. The three states of CheckBox are checked, unchecked, and indeterminate.

## Key features
## Key Features

* Supports three states.
* Allow users to select and clear the control by tapping.
* Supports check box color, shape and label text customization.
* Allows users to select and clear the control by tapping.
* Supports CheckBox color, shape, and label text customization.

![](Images/CheckBox_Overview.png)
![Xamarin.Android CheckBox Overview](Images/CheckBox_Overview.png)
26 changes: 14 additions & 12 deletions xamarin-android/SfCheckBox/Visual-Customization.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
layout: post
title: Visual customization | SfCheckBox | Syncfusion® | Xamarin.Android
title: Visual Customization | SfCheckBox | Syncfusion® | Xamarin.Android
description: Learn how to customize the SfCheckBox CornerRadius, CheckedColor, UncheckedColor, BorderWidth, and Text.
platform: Xamarin.Android
platform: xamarin.android
control: SfCheckBox
documentation: ug
keywords: button, SfCheckBox, CheckBox
Expand All @@ -11,8 +11,8 @@ keywords: button, SfCheckBox, CheckBox

# Visual Customization

## Customizing shape
The check box shape can be customized using the [`CornerRadius`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html#Syncfusion_Android_Buttons_SfCheckBox_CornerRadius) property. This property specifies uniform radius value for every corner of the check box.
## Customizing Shape
The CheckBox shape can be customized using the [`CornerRadius`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html#Syncfusion_Android_Buttons_SfCheckBox_CornerRadius) property. This property specifies a uniform radius value for every corner of the CheckBox.

{% tabs %}
{% highlight c# %}
Expand All @@ -25,7 +25,8 @@ checkBox.CornerRadius = 5.0f;

![CheckBox CornerRadius](Images/Radius.png)

## Customizing state color
## Customizing State Color

The default state colors can be customized using the [`ButtonTintList`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html) property. The checked/unchecked/indeterminate state color is updated with `ColorStateList` to the [`ButtonTintList`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html).
{% tabs %}
{% highlight c# %}
Expand All @@ -49,14 +50,14 @@ indeterminate.ButtonTintList = new ColorStateList(states, colors);
{% endhighlight %}
{% endtabs %}

![CheckedColor and UncheckedColor in Checkbox](Images/StateColor.png)
![CheckedColor and UncheckedColor in CheckBox](Images/StateColor.png)

## BorderWidth
The border thickness of the tick box in the checkbox can be customized with the [`BorderWidth`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html#Syncfusion_Android_Buttons_SfCheckBox_BorderWidth) property.
## Border Width
The border thickness of the tick box in the CheckBox can be customized with the [`BorderWidth`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html#Syncfusion_Android_Buttons_SfCheckBox_BorderWidth) property.

{% tabs %}
{% highlight c# %}
//unchecked state and its color
// Unchecked state and its color
int[][] states = { new int[] { -Android.Resource.Attribute.StateChecked } };
int[] colors = { Color.Blue};

Expand Down Expand Up @@ -89,13 +90,14 @@ ButtonTintList = new Android.Content.Res.ColorStateList(states, colors)

![CheckBox BorderWidth](Images/BorderWidth.png)

## Setting caption text appearance
## Setting Caption Text Appearance

You can customize the display text appearance of the [`SfCheckBox`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html) control using the following properties:

* [`SetTextColor`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html): Changes the color of the text.
* [`TextAlignment`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html): Changes the horizontal alignment of the caption text.
* [`Typeface`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html): Changes the font family of the text and sets font attributes(bold/italic/none) of the caption text.
* [`TextSize`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html): Sets font size of the caption text.
* [`Typeface`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html): Changes the font family of the text and sets font attributes (bold/italic/none) of the caption text.
* [`TextSize`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.Android.Buttons.SfCheckBox.html): Sets the font size of the caption text.

{% tabs %}
{% highlight c# %}
Expand Down
Loading