menu

MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class SwitchSettings - MAUI API Reference | Syncfusion

    Show / Hide Table of Contents

    Class SwitchSettings

    Represents the switch settings class

    Inheritance
    System.Object
    SwitchSettings
    Namespace: Syncfusion.Maui.Buttons
    Assembly: Syncfusion.Maui.Buttons.dll
    Syntax
    public class SwitchSettings : Element
    Examples

    The below example shows how to initialize the switch settings.

    • XAML
    • C#
    <syncfusion:SwitchSettings/>
    SwitchSettings switchSettings = new SwitchSettings();
    this.Content = switchSettings;

    Constructors

    SwitchSettings()

    Initializes a new instance of the SwitchSettings class.

    Declaration
    public SwitchSettings()

    Fields

    CustomPathProperty

    Identifies the CustomPath bindable property.This property can be used to give the customize path to draw the rating shape.

    Declaration
    public static readonly BindableProperty CustomPathProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the CustomPath bindable property.

    IconColorProperty

    Identifies IconColor bindable property.

    Declaration
    public static readonly BindableProperty IconColorProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the IconColor bindable property.

    ThumbBackgroundProperty

    Identifies ThumbBackground bindable property.

    Declaration
    public static readonly BindableProperty ThumbBackgroundProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the ThumbBackground bindable property.

    ThumbCornerRadiusProperty

    Identifies ThumbCornerRadius bindable property.

    Declaration
    public static readonly BindableProperty ThumbCornerRadiusProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the ThumbCornerRadius bindable property.

    ThumbHeightRequestProperty

    Identifies ThumbHeightRequest bindable property.

    Declaration
    public static readonly BindableProperty ThumbHeightRequestProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the ThumbHeightRequest bindable property.

    ThumbStrokeProperty

    Identifies ThumbStroke bindable property.

    Declaration
    public static readonly BindableProperty ThumbStrokeProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the ThumbStroke bindable property.

    ThumbStrokeThicknessProperty

    Identifies ThumbStrokeThickness bindable property.

    Declaration
    public static readonly BindableProperty ThumbStrokeThicknessProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the ThumbStrokeThickness bindable property.

    ThumbWidthRequestProperty

    Identifies ThumbWidthRequest bindable property.

    Declaration
    public static readonly BindableProperty ThumbWidthRequestProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the ThumbWidthRequest bindable property.

    TrackBackgroundProperty

    Identifies TrackBackground bindable property.

    Declaration
    public static readonly BindableProperty TrackBackgroundProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the TrackBackground bindable property.

    TrackCornerRadiusProperty

    Identifies TrackCornerRadius bindable property.

    Declaration
    public static readonly BindableProperty TrackCornerRadiusProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the TrackCornerRadius bindable property.

    TrackHeightRequestProperty

    Identifies TrackHeightRequest bindable property.

    Declaration
    public static readonly BindableProperty TrackHeightRequestProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the TrackHeightRequest bindable property.

    TrackStrokeProperty

    Identifies TrackStroke bindable property.

    Declaration
    public static readonly BindableProperty TrackStrokeProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the TrackStroke bindable property.

    TrackStrokeThicknessProperty

    Identifies TrackStrokeThickness bindable property.

    Declaration
    public static readonly BindableProperty TrackStrokeThicknessProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the TrackStrokeThickness bindable property.

    TrackWidthRequestProperty

    Identifies TrackWidthRequest bindable property.

    Declaration
    public static readonly BindableProperty TrackWidthRequestProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for the TrackWidthRequest bindable property.

    Properties

    CustomPath

    Gets or sets a value to customize the path of thumb's icon.

    Declaration
    public string CustomPath { get; set; }
    Property Value
    Type
    System.String
    Examples

    The below example shows how to set the path of thumb's icon.

    • XAML
    • C#
    <syncfusion:SwitchSettings CustomPath= "M14.2051 0.744141L15.207 1.74609L5.69727 11.2559L0.792969 6.35156L1.79492 5.34961L5.69727 9.25195L14.2051 0.744141Z" />
    SwitchSettings switchSettings = new SwitchSettings();
    switchSettings.CustomPath = "M14.2051 0.744141L15.207 1.74609L5.69727 11.2559L0.792969 6.35156L1.79492 5.34961L5.69727 9.25195L14.2051 0.744141Z";
    this.Content = switchSettings;

    IconColor

    Gets or set the border color of the thumb's icon.

    Declaration
    public Color IconColor { get; set; }
    Property Value
    Type
    Microsoft.Maui.Graphics.Color
    Examples

    The below example shows how to set the border color of the thumb's icon.

    • XAML
    • C#
    <syncfusion:SwitchSettings IconColor="#21005E" />
    SwitchSettings switchSettings = new SwitchSettings();
    switchSettings.IconColor = Color.FromRgba("21005E");
    this.Content = switchSettings;

    ThumbBackground

    Gets or set the background color of the thumb.

    Declaration
    public Brush ThumbBackground { get; set; }
    Property Value
    Type
    Microsoft.Maui.Controls.Brush
    Examples

    The below example shows how to set the background color of the thumb.

    • XAML
    • C#
    <syncfusion:SwitchSettings ThumbBackground="#FFFFFF" />
    SwitchSettings switchSettings = new SwitchSettings();
    switchSettings.ThumbBackground = new SolidColorBrush(Color.FromRgba("FFFFFF"));
    this.Content = switchSettings;

    ThumbCornerRadius

    Gets or sets a value to customize the corner radius of the thumb.

    Declaration
    public CornerRadius ThumbCornerRadius { get; set; }
    Property Value
    Type
    Microsoft.Maui.CornerRadius
    Examples

    The below example shows how to set the corner radius of the thumb.

    • XAML
    • C#
    <syncfusion:SwitchSettings ThumbCornerRadius="20" />
    SwitchSettings switchSettings = new SwitchSettings();
    switchSettings.ThumbCornerRadius = 20;
    this.Content = switchSettings;

    ThumbHeightRequest

    Gets or sets a value to customize the height of the thumb.

    Declaration
    public double ThumbHeightRequest { get; set; }
    Property Value
    Type
    System.Double
    Examples

    The below example shows how to set the height of the thumb.

    • XAML
    • C#
    <syncfusion:SwitchSettings ThumbHeightRequest="14" />
    SwitchSettings switchSettings = new SwitchSettings();
    switchSettings.ThumbHeightRequest = 14;
    this.Content = switchSettings;

    ThumbStroke

    Gets or set the border color of the thumb.

    Declaration
    public Color ThumbStroke { get; set; }
    Property Value
    Type
    Microsoft.Maui.Graphics.Color
    Examples

    The below example shows how to set the border color of the thumb.

    • XAML
    • C#
    <syncfusion:SwitchSettings ThumbStroke="#FFFFFF" />
    SwitchSettings switchSettings = new SwitchSettings();
    switchSettings.ThumbStroke = Color.FromRgba("FFFFFF");
    this.Content = switchSettings;

    ThumbStrokeThickness

    Gets or sets a value to customize the border thickness of the thumb.

    Declaration
    public double ThumbStrokeThickness { get; set; }
    Property Value
    Type
    System.Double
    Examples

    The below example shows how to set the border thickness of the thumb.

    • XAML
    • C#
    <syncfusion:SwitchSettings ThumbStrokeThickness="2" />
    SwitchSettings switchSettings = new SwitchSettings();
    switchSettings.ThumbStrokeThickness = 2;
    this.Content = switchSettings;

    ThumbWidthRequest

    Gets or sets a value to customize the width of the thumb.

    Declaration
    public double ThumbWidthRequest { get; set; }
    Property Value
    Type
    System.Double
    Examples

    The below example shows how to set the width of the thumb.

    • XAML
    • C#
    <syncfusion:SwitchSettings ThumbWidthRequest="14" />
    SwitchSettings switchSettings = new SwitchSettings();
    switchSettings.ThumbWidthRequest = 14;
    this.Content = switchSettings;

    TrackBackground

    Gets or set the background color of the track.

    Declaration
    public Brush TrackBackground { get; set; }
    Property Value
    Type
    Microsoft.Maui.Controls.Brush
    Examples

    The below example shows how to set the background color of the track.

    • XAML
    • C#
    <syncfusion:SwitchSettings TrackBackground="#6750A4" />
    SwitchSettings switchSettings = new SwitchSettings();
    switchSettings.TrackBackground = new SolidColorBrush(Color.FromRgba("6750A4"));
    this.Content = switchSettings;

    TrackCornerRadius

    Gets or sets a value to customize the corner radius of the track.

    Declaration
    public CornerRadius TrackCornerRadius { get; set; }
    Property Value
    Type
    Microsoft.Maui.CornerRadius
    Examples

    The below example shows how to set the corner radius of the track.

    • XAML
    • C#
    <syncfusion:SwitchSettings TrackCornerRadius="20" />
    SwitchSettings switchSettings = new SwitchSettings();
    switchSettings.TrackCornerRadius = 20;
    this.Content = switchSettings;

    TrackHeightRequest

    Gets or sets a value to customize the height of the track.

    Declaration
    public double TrackHeightRequest { get; set; }
    Property Value
    Type
    System.Double
    Examples

    The below example shows how to set the height of the track.

    • XAML
    • C#
    <syncfusion:SwitchSettings TrackHeightRequest="30" />
    SwitchSettings switchSettings = new SwitchSettings();
    switchSettings.TrackHeightRequest = 30;
    this.Content = switchSettings;

    TrackStroke

    Gets or set the border color of the track.

    Declaration
    public Color TrackStroke { get; set; }
    Property Value
    Type
    Microsoft.Maui.Graphics.Color
    Examples

    The below example shows how to set the border color of the track.

    • XAML
    • C#
    <syncfusion:SwitchSettings TrackStroke="#6750A4" />
    SwitchSettings switchSettings = new SwitchSettings();
    switchSettings.TrackStroke = Color.FromRgba("6750A4");
    this.Content = switchSettings;

    TrackStrokeThickness

    Gets or sets a value to customize the border thickness of the track.

    Declaration
    public double TrackStrokeThickness { get; set; }
    Property Value
    Type
    System.Double
    Examples

    The below example shows how to set the border thickness of the track.

    • XAML
    • C#
    <syncfusion:SwitchSettings TrackStrokeThickness="2" />
    SwitchSettings switchSettings = new SwitchSettings();
    switchSettings.TrackStrokeThickness = 2;
    this.Content = switchSettings;

    TrackWidthRequest

    Gets or sets a value to customize the width of the track.

    Declaration
    public double TrackWidthRequest { get; set; }
    Property Value
    Type
    System.Double
    Examples

    The below example shows how to set the width of the track.

    • XAML
    • C#
    <syncfusion:SwitchSettings TrackWidthRequest="50" />
    SwitchSettings switchSettings = new SwitchSettings();
    switchSettings.TrackWidthRequest = 50;
    this.Content = switchSettings;
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved