locked
Mouse panning issues in Flipview

    Question

  • Hi,

    I have a problem in mouse panning issues in WinJS Flipview control.

    Here is my sample:

    https://skydrive.live.com/redir?resid=533F417A2E04AEC4!1009

    My problem is: I can zoom images in flipview and panning, zooming or scrolling them via finger touch.

    So, is there a simple way to enable mouse panning, scrolling?

    I think it is useless to zoom if the user cannot drag image by mouse if there is no touch device.

    Thanks so much.

    Nick

    Tuesday, December 30, 2014 8:12 AM

Answers

  • I think adding MSGesture is a fine idea. What you're experiencing here is just a difference in the native workings of touch and mouse, so you have to manually compensate for these differences.

    Because panning and pinch/zoom in touch mode give you behaviors that are not directly translatable to mouse actions, the mouse does not interpret similar actions unless you ask it do.

    Panning with a finger is the most natural thing to expect for touchmode, but it does not directly translate into click and drag, and for that reason, mouse does not pan.  However, you can just add the event so that you get the same behavior.  It's extra work, but you have to take into account that not all developers want the same behavior.  For example, I expect that someone will say "I don't want to pan when I touch the screen, I want to draw a line, like I can with a mouse.  How do I disable this behavior?"

    I hope this clears things up for you.


    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.

    • Marked as answer by UOWNICK Tuesday, January 06, 2015 2:29 AM
    Wednesday, December 31, 2014 1:19 PM
    Moderator

All replies

  • Perhaps you should add a mousewheel event to the image so you can zoom in/out based on the direction of the mousewheel. 

    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 30, 2014 2:32 PM
    Moderator
  • Hi Matt,

    Thanks for reply.

    I can add mouse wheel event to zoom image.

    My problem is: is there a simple way to enable mouse panning, scrolling when images zoomed larger than screen resolution? (Now, I can only pan larger images with finger drag)

    Or, just add MSGesture... event to handle? (this may be quite difficult to handle zoom, pan, scale with mscontentzoom attribute together)

    Wednesday, December 31, 2014 1:18 AM
  • I think adding MSGesture is a fine idea. What you're experiencing here is just a difference in the native workings of touch and mouse, so you have to manually compensate for these differences.

    Because panning and pinch/zoom in touch mode give you behaviors that are not directly translatable to mouse actions, the mouse does not interpret similar actions unless you ask it do.

    Panning with a finger is the most natural thing to expect for touchmode, but it does not directly translate into click and drag, and for that reason, mouse does not pan.  However, you can just add the event so that you get the same behavior.  It's extra work, but you have to take into account that not all developers want the same behavior.  For example, I expect that someone will say "I don't want to pan when I touch the screen, I want to draw a line, like I can with a mouse.  How do I disable this behavior?"

    I hope this clears things up for you.


    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.

    • Marked as answer by UOWNICK Tuesday, January 06, 2015 2:29 AM
    Wednesday, December 31, 2014 1:19 PM
    Moderator