Prevent RadSlideView from sliding

3 posts, 0 answers
  1. Aleksey
    Aleksey avatar
    3 posts
    Member since:
    Apr 2013

    Posted 22 Apr 2013 Link to this post

    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. Todor
    Admin
    Todor avatar
    778 posts

    Posted 25 Apr 2013 Link to this post

    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.
  3. DevCraft banner
  4. Aleksey
    Aleksey avatar
    3 posts
    Member since:
    Apr 2013

    Posted 25 Apr 2013 Link to this post

    Thank you for your help! I will implement this, and of course, it will be great to use this feature with more comfort :)
Back to Top