none
Pan and Zoom not working with WPF ScrollViewer RRS feed

  • Question

  • I must have committed an egregious newbie error but maybe the child control is swallowing required events. Most other Kinect region interactions (cursor move, button click and slider grab) are working fine. Here's the XAML snippet:

        <k:KinectRegion x:Name="kinectRegion">
            <Grid Name="gridMain" Background="#00000000">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <ScrollViewer Grid.Row="1" 
                          HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"
                          k:KinectRegion.IsHorizontalRailEnabled="true" k:KinectRegion.IsVerticalRailEnabled="true"
                          k:KinectRegion.ZoomMode="Enabled">
                    <igwc:PageView Name="igPageView1" Background="Black" OpenAnnotations="False"
                               Grid.Row="0" Grid.Column="0"/>
                </ScrollViewer>
    Thanks for any suggests or guidance that comes to mind. Maybe someone else has experienced this...

    Pat Pattillo

    Tuesday, October 3, 2017 3:32 AM

Answers

  • I have no insights into the imaging SDK but assume it's using RenderTransform rather than LayoutTransform property of Image class. This was resolved using VisualTreeHelper to access Image instance then to set Image instance LayoutTransform property to a desired ScaleTransform.

    Maybe this will help someone else with a similar problem.

    Pat Pattillo

    • Marked as answer by SixFootGlass Thursday, October 5, 2017 12:39 AM
    Thursday, October 5, 2017 12:39 AM

All replies

  • Inheritance Hierarchy is:

    UIElement
    FrameworkElement
    Control
    PageView


    Pat Pattillo

    Tuesday, October 3, 2017 3:43 AM
  • Apparently the Zoom function I'm using from the imaging SDK that hosts the image in its own control interferes with the approach that the Kinect SDK uses. I substituted an Image control for the PageView control and that worked as expected and just like the Kinect SDK Control Basics ScrollViewer sample. Then I added the imaging SDK PageView control back and resized the Window to force the ScrollBars and gesture based scrolling worked. Anytime the imaging SDK Zoom function is used scrolling stops working.

    Pat Pattillo


    • Edited by SixFootGlass Wednesday, October 4, 2017 10:46 PM
    Wednesday, October 4, 2017 10:45 PM
  • I have no insights into the imaging SDK but assume it's using RenderTransform rather than LayoutTransform property of Image class. This was resolved using VisualTreeHelper to access Image instance then to set Image instance LayoutTransform property to a desired ScaleTransform.

    Maybe this will help someone else with a similar problem.

    Pat Pattillo

    • Marked as answer by SixFootGlass Thursday, October 5, 2017 12:39 AM
    Thursday, October 5, 2017 12:39 AM