locked
Problems with ScrollViewer Scrolling behavior RRS feed

  • Question

  • Hi

        There is a ScrollViewer and the child element is an image.

        The ScrollViewer supports Zooming and Scrolling, and is this right to Scroll the image out of sight?

        It can reappear in MS sample(Scenario 3)

        code.msdn.microsoft.com/windowsapps/XAML-ScrollViewer-pan-and-949d29e9

        Firstly,  use a figure to scroll the image and hold, then use another figure to scroll the image in the same direct.

        The image should be scroll out of sight.

        I find win 8.1 Photos App even has this problem, is it right? How to avoid the behavior?

     

        Thanks.

       


    • Edited by Bin.W Wednesday, December 4, 2013 12:21 PM edit the link
    Wednesday, December 4, 2013 12:21 PM

Answers

  • Hi Bin and Will,

    There is no way to override the ScrollViewer in this way. It allows the user to overscroll a bit, but will revert that when the user releases.

    To get different behavior you would need to write your own scrolling system. If you just need zooming you can handle the manipulation events directly and limit them to specific regions, sizes, etc.

    --Rob

    Thursday, December 5, 2013 2:33 AM
    Moderator

All replies

  • Hello,everyone:

    I develop Windows store app on Windows8.1 with Visual Studio 2013.

    I use ScrollViewer to zoom an image by putting image in ScrollViewer.

    But after zooming out the image, 

    I found I can drag the image out of ScrollViewer with fingers one by one.

    Thanks!

    Tuesday, December 3, 2013 12:27 PM
  • Is this a problem or are you just describing something you can do?


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Tuesday, December 3, 2013 8:19 PM
    Moderator
  • I'm not sure what you mean. Can you please explain more clearly the steps you are taking and the difference between the behavior you desire and the behavior you get?

    --Rob

    Wednesday, December 4, 2013 11:11 PM
    Moderator
  • Hi, Rob

        Thanks for your reply.

        In the situation of the value of ScrollableHeight is zero, and then scroll down the scrollviewer using a finger till it cannot be scrolled, hold the finger on the scrollviewer and use another finger to scroll down it , now you can scroll the content of scrollviewer to anywhere even out of sight.

       This sample(Scenario 3) can appear the situation.

    code.msdn.microsoft.com/windowsapps/XAML-ScrollViewer-pan-and-949d29e9

       What I want is avoiding the behavior, I donnot expect the behavior that scrolling the content of scrollviewer out of sight.Is it possiple?

        Thanks.

       

    Thursday, December 5, 2013 1:37 AM
  • Hi, Matt:

    I think this is a problem.

    I tried the Photos App on Windows8.1, after I zoom out a photo, I can drag most part of the photo out of screen with fingers one by one. But after I release my fingers, the photo return to where it should be. It's the problem what I described.

    Thank you!

    Thursday, December 5, 2013 1:56 AM
  • Hi Bin and Will,

    There is no way to override the ScrollViewer in this way. It allows the user to overscroll a bit, but will revert that when the user releases.

    To get different behavior you would need to write your own scrolling system. If you just need zooming you can handle the manipulation events directly and limit them to specific regions, sizes, etc.

    --Rob

    Thursday, December 5, 2013 2:33 AM
    Moderator