Class SelectionIndicatorSettings
Provides a set of properties to customize the selection indicator in the SfSegmentedControl. The selection indicator is a strip used to indicate the selected index in the SfSegmentedControl View.
Inheritance
Namespace: Syncfusion.Maui.Toolkit.SegmentedControl
Assembly: Syncfusion.Maui.Toolkit.dll
Syntax
public class SelectionIndicatorSettings : Element, IThemeElement
Constructors
SelectionIndicatorSettings()
Initializes a new instance of the SelectionIndicatorSettings class.
Declaration
public SelectionIndicatorSettings()
Fields
BackgroundProperty
Identifies the Background dependency property.
Declaration
public static readonly BindableProperty BackgroundProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for Background dependency property. |
SelectionIndicatorPlacementProperty
Identifies the SelectionIndicatorPlacement dependency property.
Declaration
public static readonly BindableProperty SelectionIndicatorPlacementProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for SelectionIndicatorPlacement dependency property. |
StrokeProperty
Identifies the Stroke dependency property.
Declaration
public static readonly BindableProperty StrokeProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for Stroke dependency property. |
StrokeThicknessProperty
Identifies the StrokeThickness dependency property.
Declaration
public static readonly BindableProperty StrokeThicknessProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for StrokeThickness dependency property. |
TextColorProperty
Identifies the TextColor dependency property.
Declaration
public static readonly BindableProperty TextColorProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for TextColor dependency property. |
Properties
Background
Gets or sets the background brush for the selection indicator in the SfSegmentedControl.
Declaration
public Brush Background { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.Brush | The default value of Background is "new SolidColorBrush(Color.FromArgb("#6750A4"))". |
Remarks
It is applicable to only when the selection mode is set to Fill, and for border selection, the text color of the selected item is determined by the Background property.
Examples
The below examples shows, how to set the Background property of SelectionIndicatorSettings in the SfSegmentedControl.
<button:SfSegmentedControl x:Name="segmentedControl">
<button:SfSegmentedControl.SelectionIndicatorSettings>
<button:SelectionIndicatorSettings Background="Orange"/>
</button:SfSegmentedControl.SelectionIndicatorSettings>
<button:SfSegmentedControl.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Day</x:String>
<x:String>Week</x:String>
<x:String>Month</x:String>
<x:String>Year</x:String>
</x:Array>
</button:SfSegmentedControl.ItemsSource>
</button:SfSegmentedControl>
SelectionIndicatorPlacement
Gets or sets the selection mode for the selection indicator in the SfSegmentedControl.
Declaration
public SelectionIndicatorPlacement SelectionIndicatorPlacement { get; set; }
Property Value
Type | Description |
---|---|
SelectionIndicatorPlacement | The default value of SelectionIndicatorPlacement is Fill. |
Remarks
When the selection mode is set to Fill, the selected item's appearance is determined by the Background property. However, when the selection mode is set to Border, TopBorder, or BottomBorder, the selected color is determined by the Stroke and StrokeThickness properties, and for border selection, the text color of the selected item is determined by the Background property.
Examples
The below examples shows, how to set the SelectionIndicatorPlacement property of SelectionIndicatorSettings in the SfSegmentedControl.
<button:SfSegmentedControl x:Name="segmentedControl">
<button:SfSegmentedControl.SelectionIndicatorSettings>
<button:SelectionIndicatorSettings SelectionIndicatorPlacement="Border"/>
</button:SfSegmentedControl.SelectionIndicatorSettings>
<button:SfSegmentedControl.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Day</x:String>
<x:String>Week</x:String>
<x:String>Month</x:String>
<x:String>Year</x:String>
</x:Array>
</button:SfSegmentedControl.ItemsSource>
</button:SfSegmentedControl>
Stroke
Gets or sets the stroke color for the selection indicator in the SfSegmentedControl.
Declaration
public Color Stroke { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Graphics.Color | The default value of Stroke is "Color.FromArgb("#6750A4")". |
Remarks
It is applicable to only when the selection mode is set to Border, TopBorder, or BottomBorder.
Examples
The below examples shows, how to set the Stroke property of SelectionIndicatorSettings in the SfSegmentedControl.
<button:SfSegmentedControl x:Name="segmentedControl">
<button:SfSegmentedControl.SelectionIndicatorSettings>
<button:SelectionIndicatorSettings Stroke="Orange"/>
</button:SfSegmentedControl.SelectionIndicatorSettings>
<button:SfSegmentedControl.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Day</x:String>
<x:String>Week</x:String>
<x:String>Month</x:String>
<x:String>Year</x:String>
</x:Array>
</button:SfSegmentedControl.ItemsSource>
</button:SfSegmentedControl>
StrokeThickness
Gets or sets the stroke thickness for the selection indicator in the SfSegmentedControl.
Declaration
public double StrokeThickness { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value of StrokeThickness is 3. |
Remarks
It is applicable to only when the selection mode is set to Border, TopBorder, or BottomBorder.
Examples
The below examples shows, how to set the StrokeThickness property of SelectionIndicatorSettings in the SfSegmentedControl.
<button:SfSegmentedControl x:Name="segmentedControl">
<button:SfSegmentedControl.SelectionIndicatorSettings>
<button:SelectionIndicatorSettings StrokeThickness="5"/>
</button:SfSegmentedControl.SelectionIndicatorSettings>
<button:SfSegmentedControl.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Day</x:String>
<x:String>Week</x:String>
<x:String>Month</x:String>
<x:String>Year</x:String>
</x:Array>
</button:SfSegmentedControl.ItemsSource>
</button:SfSegmentedControl>
TextColor
Gets or sets the text color for the selection indicator in the SfSegmentedControl.
Declaration
public Color TextColor { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Graphics.Color | The default value of TextColor is Microsoft.Maui.Graphics.Colors.White. |
Remarks
It is not applicable to when the Text is System.String.Empty.
Examples
The below examples shows, how to set the TextColor property of SelectionIndicatorSettings in the SfSegmentedControl.
<button:SfSegmentedControl x:Name="segmentedControl">
<button:SfSegmentedControl.SelectionIndicatorSettings>
<button:SelectionIndicatorSettings TextColor="Red"/>
</button:SfSegmentedControl.SelectionIndicatorSettings>
<button:SfSegmentedControl.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Day</x:String>
<x:String>Week</x:String>
<x:String>Month</x:String>
<x:String>Year</x:String>
</x:Array>
</button:SfSegmentedControl.ItemsSource>
</button:SfSegmentedControl>