New to Telerik UI for Xamarin? Download free 30-day trial

Events

RadSlideView provides the following events:

  • SlidingToIndex: Occurs when the current selection is changing (executing a slide). The SlidingToIndex event handler receives two parameters:

    • The sender argument which is of type RadSlideViewPresenter (it contains all the properties of the SlideView itself);
    • А SlideViewSlidingToIndexEventArgs object which exposes the new index and a cancellation option via the Index and Cancel properties. Setting the Cancel property of the event arguments to True will stop the sliding action.
  • SlidedToIndex: Occurs when the current selection is changed (a slide is executed). The SlidingToIndex event handler receives two parameters:

    • The sender argument which is of type RadSlideViewPresenter;
    • А SlideViewSlidedToIndexEventArgs object which exposes the new index via the Index property.

Example

Here is a quick example how to handle SlidingToIndex event of RadSlideView.

First, add the SlideView definition:

<telerikPrimitives:RadSlideView x:Name="slideView"
                                SlidingToIndex="GoingToNextSlide">
    <telerikPrimitives:RadSlideView.ItemsSource>
        <x:Array Type="{x:Type ContentView}">
            <ContentView>
                <telerikInput:RadCalendar Margin="50, 30" />
            </ContentView>
            <ContentView>
                <Label HorizontalOptions="Center" 
                       VerticalOptions="CenterAndExpand" Text="Other View" TextColor="Blue" />
            </ContentView>
            <ContentView>
                <Label HorizontalOptions="Center" VerticalOptions="CenterAndExpand" Text="Another View" TextColor="Red" />
            </ContentView>
        </x:Array>
    </telerikPrimitives:RadSlideView.ItemsSource>
</telerikPrimitives:RadSlideView>

And then, the event handler (in the sample it just displays a message):

private void GoingToNextSlide(object sender, SlideViewSlidingToIndexEventArgs e)
{
    var slideView = sender as RadSlideViewPresenter;
    if (slideView.SelectedIndex != -1)
        Application.Current.MainPage.DisplayAlert("", "You're going from Slide " + slideView.SelectedIndex + " to Slide " + e.Index, "OK");
}

See Also

In this article