Enabling Navigation between SlideView Items by Using the Indicator
Environment
Version | Product | Author |
---|---|---|
6.6.0 | Telerik UI for .NET MAUI SlideView | Dobrinka Yordanova |
Description
I want to enable users to navigate to the different SlideView items by using the indicator. Currently, changing the item with the indicator works fine on desktop, but isn't possible on mobile devices.
Solution
To enable navigation through the indicator in SlideView for .NET MAUI, follow these steps:
1. In your XAML file, add the following namespace declarations:
xmlns:telerik="http://schemas.telerik.com/2022/xaml/maui"
2. Inside the ContentPage
element, create a ResourceDictionary
and define a style for the SlideViewIndicator
:
<ContentPage.Resources>
<ResourceDictionary>
<Style x:Key="IndicatorStyle" TargetType="telerik:SlideViewIndicator">
<Setter Property="NavigateOnItemTap" Value="True" />
</Style>
</ResourceDictionary>
</ContentPage.Resources>
3. Add the IndicatorStyle
to your RadSlideView
control and set the NavigateOnItemTap
property to True
:
<telerik:RadSlideView x:Name="slideview" AutomationId="slideView" IndicatorStyle="{StaticResource IndicatorStyle}">
<!-- Add your slide view items here -->
</telerik:RadSlideView>
By following these steps, you enable mobile device users to switch between SlideView items by tapping the indicator.
Notes
For all available SlideView indicator properties, see the .NET MAUI SlideView Indicator article.