Class
RadSegmentedControl

Displays a list of horizontally aligned, mutually exclusive options, which can be selected by the user. Each option is a button that can display text or an image.

Definition

Namespace:Telerik.Maui.Controls

Assembly:Telerik.Maui.Controls.dll

Syntax:

cs-api-definition
public class RadSegmentedControl : RadBorder, IRadBorder, IRadContentView, IContentView, IView, IElement, ITransform, IPadding, ICrossPlatformLayout

Inheritance: objectRadContentViewRadBorderRadSegmentedControl

Implements: IContentViewICrossPlatformLayoutIElementIPaddingIRadBorderIRadContentViewITransformIView

Inherited Members RadBorder.BorderColorPropertyRadBorder.CornerRadiusPropertyRadBorder.BorderThicknessPropertyRadBorder.BorderBrushPropertyRadBorder.ChangeVisualState()RadBorder.BorderColorRadBorder.CornerRadiusRadBorder.BorderThicknessRadBorder.BorderBrushRadContentView.ActualStyleClassPropertyRadContentView.OnChildAdded(Element)RadContentView.OnChildRemoved(Element, int)RadContentView.OnBindingContextChanged()RadContentView.OnHandlerChanged()

Constructors

RadSegmentedControl()

Initializes a new instance of the RadSegmentedControl class.

Declaration

cs-api-definition
public RadSegmentedControl()

Fields

ActualSelectionIndicatorStyleProperty

Identifies the ActualSelectionIndicatorStyle bindable property.

Declaration

cs-api-definition
public static readonly BindableProperty ActualSelectionIndicatorStyleProperty

Field Value

BindableProperty

ActualSeparatorStyleProperty

Identifies the ActualSeparatorStyle bindable property.

Declaration

cs-api-definition
public static readonly BindableProperty ActualSeparatorStyleProperty

Field Value

BindableProperty

ControlTemplateProperty

Identifies the ControlTemplate bindable property.

Declaration

cs-api-definition
public static readonly BindableProperty ControlTemplateProperty

Field Value

BindableProperty

CurrentItemProperty

Identifies the CurrentItem bindable property.

Declaration

cs-api-definition
public static readonly BindableProperty CurrentItemProperty

Field Value

BindableProperty

DisplayMemberPathProperty

Identifies the DisplayMemberPath bindable property.

Declaration

cs-api-definition
public static readonly BindableProperty DisplayMemberPathProperty

Field Value

BindableProperty

ItemTappedCommandProperty

Identifies the ItemTappedCommand bindable property.

Declaration

cs-api-definition
public static readonly BindableProperty ItemTappedCommandProperty

Field Value

BindableProperty

ItemTemplateProperty

Identifies the ItemTemplate bindable property.

Declaration

cs-api-definition
public static readonly BindableProperty ItemTemplateProperty

Field Value

BindableProperty

ItemViewStyleProperty

Identifies the ItemViewStyle bindable property.

Declaration

cs-api-definition
public static readonly BindableProperty ItemViewStyleProperty

Field Value

BindableProperty

ItemViewStyleSelectorProperty

Identifies the ItemViewStyleSelector bindable property.

Declaration

cs-api-definition
public static readonly BindableProperty ItemViewStyleSelectorProperty

Field Value

BindableProperty

ItemsSourceProperty

Identifies the ItemsSource bindable property.

Declaration

cs-api-definition
public static readonly BindableProperty ItemsSourceProperty

Field Value

BindableProperty

PaddingProperty

Identifies the Padding bindable property.

Declaration

cs-api-definition
public static readonly BindableProperty PaddingProperty

Field Value

BindableProperty

SelectedIndexProperty

Identifies the SelectedIndex bindable property.

Declaration

cs-api-definition
public static readonly BindableProperty SelectedIndexProperty

Field Value

BindableProperty

SelectedItemProperty

Identifies the SelectedItem bindable property.

Declaration

cs-api-definition
public static readonly BindableProperty SelectedItemProperty

Field Value

BindableProperty

SelectionIndicatorStyleProperty

Identifies the SelectionIndicatorStyle bindable property.

Declaration

cs-api-definition
public static readonly BindableProperty SelectionIndicatorStyleProperty

Field Value

BindableProperty

SelectionModeProperty

Identifies the SelectionMode bindable property.

Declaration

cs-api-definition
public static readonly BindableProperty SelectionModeProperty

Field Value

BindableProperty

SeparatorStyleProperty

Identifies the SeparatorStyle bindable property.

Declaration

cs-api-definition
public static readonly BindableProperty SeparatorStyleProperty

Field Value

BindableProperty

StyleProperty

Identifies the Style bindable property.

Declaration

cs-api-definition
public static readonly BindableProperty StyleProperty

Field Value

BindableProperty

Properties

ActualSelectionIndicatorStyle

Gets the actual style applied to the selection indicator, computed by merging the user-provided SelectionIndicatorStyle with the default style.

Declaration

cs-api-definition
public Style ActualSelectionIndicatorStyle { get; }

Property Value

Style

ActualSeparatorStyle

Gets the actual style applied to the separator rectangles between items, computed by merging the user-provided SeparatorStyle with the default style.

Declaration

cs-api-definition
public Style ActualSeparatorStyle { get; }

Property Value

Style

ControlTemplate

Gets or sets the control template of this view.

Declaration

cs-api-definition
public ControlTemplate ControlTemplate { get; set; }

Property Value

ControlTemplate

CurrentItem

Gets or sets the current item in the segmented control for keyboard navigation purposes. This is primarily used on desktop platforms to track which item has keyboard focus. The current item is visually highlighted and can be navigated using arrow keys.

Declaration

cs-api-definition
public object CurrentItem { get; set; }

Property Value

object

DisplayMemberPath

Gets or sets the path to the property of the data item which will be used to display text in each segment.

Declaration

cs-api-definition
public string DisplayMemberPath { get; set; }

Property Value

string

ItemTappedCommand

Gets or sets the command that is executed when a segment item is tapped. The command parameter is the data item of the tapped segment.

Declaration

cs-api-definition
public ICommand ItemTappedCommand { get; set; }

Property Value

ICommand

ItemTemplate

Gets or sets the DataTemplate that defines the appearance of each segment item. When set, replaces the default label content with custom content created from this template.

Declaration

cs-api-definition
public DataTemplate ItemTemplate { get; set; }

Property Value

DataTemplate

ItemViewStyle

Gets or sets the Style applied uniformly to each RadSegmentedControlItemView.

Declaration

cs-api-definition
public Style ItemViewStyle { get; set; }

Property Value

Style

ItemViewStyleSelector

Gets or sets the IStyleSelector that provides per-item style logic for RadSegmentedControlItemView instances. When set, the selector is invoked with the business item and the container view to determine the applied style.

Declaration

cs-api-definition
public IStyleSelector ItemViewStyleSelector { get; set; }

Property Value

IStyleSelector

ItemsSource

Gets or sets the collection of items of the control.

Declaration

cs-api-definition
public IEnumerable ItemsSource { get; set; }

Property Value

IEnumerable

Padding

Gets or sets the padding inside the control, between its border and content.

Declaration

cs-api-definition
public Thickness Padding { get; set; }

Property Value

Thickness

SelectedIndex

Gets or sets the index of the item to be selected.

Declaration

cs-api-definition
public int SelectedIndex { get; set; }

Property Value

int

SelectedItem

Gets or sets the currently selected item.

Declaration

cs-api-definition
public object SelectedItem { get; set; }

Property Value

object

SelectionIndicatorStyle

Gets or sets the Style applied to the selection indicator.

Declaration

cs-api-definition
public Style SelectionIndicatorStyle { get; set; }

Property Value

Style

SelectionMode

Gets or sets the selection mode that determines how items can be selected.

Declaration

cs-api-definition
public SegmentedControlSelectionMode SelectionMode { get; set; }

Property Value

SegmentedControlSelectionMode

SeparatorStyle

Gets or sets the Style applied to each separator rectangle between segment items.

Declaration

cs-api-definition
public Style SeparatorStyle { get; set; }

Property Value

Style

Style

Gets or sets the style of this view.

Declaration

cs-api-definition
public Style Style { get; set; }

Property Value

Style

Methods

IsSegmentEnabled(int)

Determines if the specified segment is enabled.

Declaration

cs-api-definition
public bool IsSegmentEnabled(int index)

Parameters

index

int

The index of the segment.

Returns

bool

The state of the segment: True - enabled, False - disabled.

OnApplyTemplate()

Declaration

cs-api-definition
protected override void OnApplyTemplate()

SetSegmentEnabled(int, bool)

Sets the enabled state of the specified segment.

Declaration

cs-api-definition
public void SetSegmentEnabled(int index, bool isEnabled)

Parameters

index

int

The index of the segment to enable or disable.

isEnabled

bool

The new state of the segment: True - enabled, False - disabled.

Events

ItemTapped

Raised when an item is tapped, regardless of the SelectionMode.

Declaration

cs-api-definition
public event EventHandler<RadTappedEventArgs<object>> ItemTapped

Event Value

EventHandler<RadTappedEventArgs<object>>

SelectionChanged

Raised when the current selection has changed.

Declaration

cs-api-definition
public event EventHandler<RadSelectionChangedEventArgs> SelectionChanged

Event Value

EventHandler<RadSelectionChangedEventArgs>