ScrollViewer gestures not working well with ScaleTransform
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.
Re: ScrollViewer gestures not working well with ScaleTransfo
Could you please file a bug about the touch problem. It is not the expected behavior. Although I would like to see how you are scaling the grid. Please attach the xaml or scene in the ticket.
About adjusting automatically the resolution, ViewBox is the container for that purpose. Search in our forums about it, you will find plenty of information.
By the way, our sales manager sent you an email, did you receive it?
Thanks!
About adjusting automatically the resolution, ViewBox is the container for that purpose. Search in our forums about it, you will find plenty of information.
By the way, our sales manager sent you an email, did you receive it?
Thanks!
Re: ScrollViewer gestures not working well with ScaleTransfo
Hi jsantos,
I will make a bug report as soon as I have the necessary credentials. I'll be in contact with your account manager.
In the meantime, it seems that your suggestion of using a Viewbox has the same problem. You can reproduce it like this:
When you deploy this on a device, you'll see that the content scrolls much faster than the movement of your finger.
I really hope that you can fix this soon, because it makes gestures not usable which is really a shame on touchscreens. There is also a nasty side-effect of this issue: because of this scaling not being handled correctly, a simple 'click' on a control inside the scrollviewer will often be interpreted as a scroll-touch. For this reason I had to disable 'IsManipulationEnabled' on all my scrollviewers.
I will make a bug report as soon as I have the necessary credentials. I'll be in contact with your account manager.
In the meantime, it seems that your suggestion of using a Viewbox has the same problem. You can reproduce it like this:
Code: Select all
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Viewbox>
<Grid Height="300"> <!-- Make sure this height is smaller than the available pixels on your device -->
<ScrollViewer IsManipulationEnabled="True" PanningMode="VerticalOnly">
<ItemsControl>
<TextBlock Text="test" Margin="30,30"/>
<TextBlock Text="test" Margin="30,30"/>
<TextBlock Text="test" Margin="30,30"/>
<TextBlock Text="test" Margin="30,30"/>
<TextBlock Text="test" Margin="30,30"/>
<TextBlock Text="test" Margin="30,30"/>
<TextBlock Text="test" Margin="30,30"/>
<TextBlock Text="test" Margin="30,30"/>
<TextBlock Text="test" Margin="30,30"/>
<TextBlock Text="test" Margin="30,30"/>
<TextBlock Text="test" Margin="30,30"/>
<TextBlock Text="test" Margin="30,30"/>
</ItemsControl>
</ScrollViewer>
</Grid>
</Viewbox>
</Grid>
I really hope that you can fix this soon, because it makes gestures not usable which is really a shame on touchscreens. There is also a nasty side-effect of this issue: because of this scaling not being handled correctly, a simple 'click' on a control inside the scrollviewer will often be interpreted as a scroll-touch. For this reason I had to disable 'IsManipulationEnabled' on all my scrollviewers.
Re: ScrollViewer gestures not working well with ScaleTransfo
Yes, it is a bug. We are giving high priority here. Please, attach the given xaml in the bug report.
Thanks and sorry for the inconvenience.
Thanks and sorry for the inconvenience.
Re: ScrollViewer gestures not working well with ScaleTransfo
Fixed in v1.1.8
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 4 guests