New to Telerik UI for .NET MAUIStart a free 30-day trial

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:

C#
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

Initializes a new instance of the RadSegmentedControl class.

C#
public RadSegmentedControl()

Fields

Identifies the ActualSelectionIndicatorStyle bindable property.

C#
public static readonly BindableProperty ActualSelectionIndicatorStyleProperty

Identifies the ActualSeparatorStyle bindable property.

C#
public static readonly BindableProperty ActualSeparatorStyleProperty

ControlTemplateProperty

BindableProperty

Identifies the ControlTemplate bindable property.

C#
public static readonly BindableProperty ControlTemplateProperty

CurrentItemProperty

BindableProperty

Identifies the CurrentItem bindable property.

C#
public static readonly BindableProperty CurrentItemProperty

Identifies the DisplayMemberPath bindable property.

C#
public static readonly BindableProperty DisplayMemberPathProperty

ItemsSourceProperty

BindableProperty

Identifies the ItemsSource bindable property.

C#
public static readonly BindableProperty ItemsSourceProperty

Identifies the ItemTappedCommand bindable property.

C#
public static readonly BindableProperty ItemTappedCommandProperty

ItemTemplateProperty

BindableProperty

Identifies the ItemTemplate bindable property.

C#
public static readonly BindableProperty ItemTemplateProperty

ItemViewStyleProperty

BindableProperty

Identifies the ItemViewStyle bindable property.

C#
public static readonly BindableProperty ItemViewStyleProperty

Identifies the ItemViewStyleSelector bindable property.

C#
public static readonly BindableProperty ItemViewStyleSelectorProperty

PaddingProperty

BindableProperty

Identifies the Padding bindable property.

C#
public static readonly BindableProperty PaddingProperty

SelectedIndexProperty

BindableProperty

Identifies the SelectedIndex bindable property.

C#
public static readonly BindableProperty SelectedIndexProperty

SelectedItemProperty

BindableProperty

Identifies the SelectedItem bindable property.

C#
public static readonly BindableProperty SelectedItemProperty

Identifies the SelectionIndicatorStyle bindable property.

C#
public static readonly BindableProperty SelectionIndicatorStyleProperty

SelectionModeProperty

BindableProperty

Identifies the SelectionMode bindable property.

C#
public static readonly BindableProperty SelectionModeProperty

SeparatorStyleProperty

BindableProperty

Identifies the SeparatorStyle bindable property.

C#
public static readonly BindableProperty SeparatorStyleProperty

StyleProperty

BindableProperty

Identifies the Style bindable property.

C#
public static readonly BindableProperty StyleProperty

Properties

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

C#
public Style ActualSelectionIndicatorStyle { get; }

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

C#
public Style ActualSeparatorStyle { get; }

ControlTemplate

ControlTemplate

Gets or sets the control template of this view.

C#
public ControlTemplate ControlTemplate { get; set; }

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.

C#
public object CurrentItem { get; set; }

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

C#
public string DisplayMemberPath { get; set; }

Gets or sets the collection of items of the control.

C#
public IEnumerable ItemsSource { get; set; }

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.

C#
public ICommand ItemTappedCommand { get; set; }

ItemTemplate

DataTemplate

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.

C#
public DataTemplate ItemTemplate { get; set; }

Gets or sets the Style applied uniformly to each RadSegmentedControlItemView. The target type of the style is RadSegmentedControlItemView.

C#
public Style ItemViewStyle { get; set; }

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.

C#
public IStyleSelector ItemViewStyleSelector { get; set; }

Padding

Thickness

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

C#
public Thickness Padding { get; set; }

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

C#
public int SelectedIndex { get; set; }

Gets or sets the currently selected item.

C#
public object SelectedItem { get; set; }

Gets or sets the Style applied to the selection indicator. The target type of the style is RadBorder.

C#
public Style SelectionIndicatorStyle { get; set; }

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

C#
public SegmentedControlSelectionMode SelectionMode { get; set; }

Gets or sets the Style applied to each separator rectangle between segment items. The target type of the style is RadBorder.

C#
public Style SeparatorStyle { get; set; }

Style

Style

Gets or sets the style of this view.

C#
public Style Style { get; set; }

Methods

Determines if the specified segment is enabled.

C#
public bool IsSegmentEnabled(int index)
Parameters:indexint

The index of the segment.

Returns:

bool

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

C#
protected override void OnApplyTemplate()

Sets the enabled state of the specified segment.

C#
public void SetSegmentEnabled(int index, bool isEnabled)
Parameters:indexint

The index of the segment to enable or disable.

isEnabledbool

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

Events

ItemTapped

EventHandler<RadTappedEventArgs<object>>

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

C#
public event EventHandler<RadTappedEventArgs<object>> ItemTapped

SelectionChanged

EventHandler<RadSelectionChangedEventArgs>

Raised when the current selection has changed.

C#
public event EventHandler<RadSelectionChangedEventArgs> SelectionChanged