This is a migrated thread and some comments may be shown as answers.

Prevent RadSlideView from sliding

2 Answers 62 Views
SlideView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Aleksey
Top achievements
Rank 1
Aleksey asked on 22 Apr 2013, 08:30 AM
Hello, Telerik!

How do I prevent RadSlideView from sliding to the left or right? Actually the problem is when I am at the first item I am able to drag a little bit to the right and I can see a part of background as RadSlideView stretching to the right and has blank area on its left.
Is it possible to switch this stretching off  and leave RadSlideView to be only draggable to the left on the first item and to the right on the last one?

Thank you.

2 Answers, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 25 Apr 2013, 07:14 AM
Hello Aleksey,

Thank you for writing.

Such a behavior is not intended in RadSlideView's design. However, you can manually handle the ManipulationDelta event and prevent the sliding. Here's one way to do it:
private void OnSlideView_ManipulationDelta(object sender, System.Windows.Input.ManipulationDeltaEventArgs e)
{
    // get the first item from your items collection
    if (this.slideView.SelectedItem == firstItem)
    {
        if (e.CumulativeManipulation.Translation.X > 0)
        {
            e.Handled = true;
        }
        // if your SlideView is with vertical orientation, you will need to check if Y (and not X) > 0
    }
    // use similar approach for handling the manipulation when the last item is selected
}

I hope this information helps.

Greetings,
Todor
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Aleksey
Top achievements
Rank 1
answered on 25 Apr 2013, 12:03 PM
Thank you for your help! I will implement this, and of course, it will be great to use this feature with more comfort :)
Tags
SlideView
Asked by
Aleksey
Top achievements
Rank 1
Answers by
Todor
Telerik team
Aleksey
Top achievements
Rank 1
Share this question
or