Kristof
Topic Author
Posts: 19
Joined: 22 Apr 2014, 14:44

ScrollViewer gestures not working well with ScaleTransform

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.
 
User avatar
jsantos
Site Admin
Posts: 4123
Joined: 20 Jan 2012, 17:18
Contact:

Re: ScrollViewer gestures not working well with ScaleTransfo

02 May 2014, 17:12

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!
 
Kristof
Topic Author
Posts: 19
Joined: 22 Apr 2014, 14:44

Re: ScrollViewer gestures not working well with ScaleTransfo

05 May 2014, 12:44

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:
<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> 
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.
 
User avatar
jsantos
Site Admin
Posts: 4123
Joined: 20 Jan 2012, 17:18
Contact:

Re: ScrollViewer gestures not working well with ScaleTransfo

05 May 2014, 16:21

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.
 
User avatar
jsantos
Site Admin
Posts: 4123
Joined: 20 Jan 2012, 17:18
Contact:

Re: ScrollViewer gestures not working well with ScaleTransfo

20 May 2014, 18:51

Fixed in v1.1.8

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 4 guests