Getting Started

Define SegmentedControl

Add RadSegmentedControl definition in XAML:

<telerikInput:RadSegmentedControl x:Name="segmentControlText"
                                  HeightRequest="60"
                                  VerticalOptions="Start">
    <telerikInput:RadSegmentedControl.ItemsSource>
        <x:Array Type="{x:Type x:String}">
            <x:String>Popular</x:String>
            <x:String>Library</x:String>
            <x:String>Playlists</x:String>
            <x:String>Friends</x:String>
        </x:Array>
    </telerikInput:RadSegmentedControl.ItemsSource>
</telerikInput:RadSegmentedControl>

Add the following namespace:

xmlns:telerikInput="clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.Maui.Compatibility"

Register the Telerik controls through Telerik.Maui.Controls.Compatibility.UseTelerik extension method called inside the Configure method of the Startup.cs file of your project:

using Telerik.Maui.Controls.Compatibility;



public void Configure(IAppHostBuilder appBuilder)
{
    appBuilder        
        .UseTelerik()
        .UseMauiApp<App>();

}              

Set segment colors

You can set the background of the segments via the SegmentBackgroundColor property. The color will be applied to all segments except the selected one. To change the background of the selected item you can set the SelectedSegmentBackgroundColor

To set the text color of the strings in the items via the SegmentTextColor property. The color of the selected segment can be set via the SelectedSegmentTextColor property.

You can find an example with the selected color properties in the Selection article.

See Also

In this article
Not finding the help you need?