ScrollViewer gestures not working well with ScaleTransform
Posted: 30 Apr 2014, 16:39
Enabling touch-gestures on a ScrollViewer does not require any custom code which is very cool:
<ScrollViewer VerticalScrollBarVisibility="Auto" IsManipulationEnabled="True" PanningMode="VerticalOnly">
However, I have a ScaleTransform on my root grid (to accommodate for high- and low-dpi displays). This ScaleTransform is set based on the DPI of the screen. Due to this ScaleTransform, the gesture on the ScrollViewer does not work correctly. E.g. when I apply a ScaleTransform of 2 and then use a drag-gesture to scroll, the content will be scrolled at twice the speed of the movement of my finger.
Is this the intended behavior? If so, how can I work around it? Or should I use another mechanism to accommodate for high-resolution DPI? Note that WPF automatically works on high-DPI displays without having to specify a ScaleTransform yourself.
<ScrollViewer VerticalScrollBarVisibility="Auto" IsManipulationEnabled="True" PanningMode="VerticalOnly">
However, I have a ScaleTransform on my root grid (to accommodate for high- and low-dpi displays). This ScaleTransform is set based on the DPI of the screen. Due to this ScaleTransform, the gesture on the ScrollViewer does not work correctly. E.g. when I apply a ScaleTransform of 2 and then use a drag-gesture to scroll, the content will be scrolled at twice the speed of the movement of my finger.
Is this the intended behavior? If so, how can I work around it? Or should I use another mechanism to accommodate for high-resolution DPI? Note that WPF automatically works on high-DPI displays without having to specify a ScaleTransform yourself.