Class DataFormSwitchItem
Represents the class that encapsulates the Switch editor settings
Inherited Members
Namespace: Syncfusion.Maui.DataForm
Assembly: Syncfusion.Maui.DataForm.dll
Syntax
public class DataFormSwitchItem : DataFormItem, IThemeElement
Constructors
DataFormSwitchItem()
Initializes a new instance of the DataFormSwitchItem class.
Declaration
public DataFormSwitchItem()
Fields
OnColorProperty
Identifies the OnColor dependency property.
Declaration
public static readonly BindableProperty OnColorProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for OnColor dependency property. |
ThumbColorProperty
Identifies the ThumbColor dependency property.
Declaration
public static readonly BindableProperty ThumbColorProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for ThumbColor dependency property. |
Properties
OnColor
Gets or sets the color of the switch when it is in the on state.
Declaration
public Color OnColor { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Graphics.Color | The default value of OnColor is |
Remarks
You can also use the ThumbColor property to customize the thumb color of the switch editor.
Examples
The below examples shows, how to use the OnColor property of DataFormSwitchItem in the SfDataForm.
<dataForm:SfDataForm x:Name="dataForm"
AutoGenerateItems="False">
<dataForm:SfDataForm.Items>
<dataForm:DataFormSwitchItem FieldName="Switch On or Off" OnColor="Orange"/>
</dataForm:SfDataForm.Items>
</dataForm:SfDataForm>
See Also
ThumbColor
Gets or sets the thumb color of the switch editor.
Declaration
public Color ThumbColor { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Graphics.Color | The default value of ThumbColor is |
Remarks
You can also use the OnColor property to customize color of the switch when it is in the "On" position.
Examples
The below examples shows, how to use the ThumbColor property of DataFormSwitchItem in the SfDataForm.
<dataForm:SfDataForm x:Name="dataForm"
AutoGenerateItems="False">
<dataForm:SfDataForm.Items>
<dataForm:DataFormSwitchItem FieldName="Switch On or Off" ThumbColor="Orange"/>
</dataForm:SfDataForm.Items>
</dataForm:SfDataForm>