Problems with ScrollViewer inside a Kinect Region RRS feed

  • Question

  • Hi,

    I'm building a WPF application using KinectRegion. I have a Scrollviewer inside the KinectRegion, scrolling with HandPointer works fine. I want to know when the scrolling interaction has finished (the user open his/her hand). Which event should I use? I thought it was ManipulationCompleted (and ManipulationStart for closing the hand) but it is not being fired.

    I also noted that the scrollviewer goes on scrolling even when the user's hand is moving outside the "screen zone", how can i disable this behavior? (so scrolling stops in the border of the screen).

    Thank you.

    Thursday, February 26, 2015 5:00 PM

All replies

  • See the controls basics sample for tips on using particular controls. What exactly are you trying to do since the control will handle all the manipulation internally. If you need lower level access, you will need to handle the lower level of the interactions. 

            <ScrollViewer Grid.Row="1" 
                        HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"
                        k:KinectRegion.IsHorizontalRailEnabled="true" k:KinectRegion.IsVerticalRailEnabled="true"
                <Image Stretch="None" Grid.Column="0" Grid.Row="0" Source="/Images/beach.jpg" />

    Carmine Sirignano - MSFT

    Friday, February 27, 2015 1:51 AM
  • Thanks Carmine, I will explain myself better.

    I would like to build a "carousel" component: a ScrollViewer with several images inside. I would like it to have some kind of "gravity effect" so when the user "drops" the carousel it will automatically navigate to a certain position (according to the extent of the scroll action). I can track scroll changes through the proper event in the ScrollViewer, but I need to know when the scrolling interaction has finished.

    For a different component, I'm using the code Rob Relyea posted here to build a custom IKinectControl so I can attach event handlers to Kinect Manipulation events (and I know when a dragging interaction has finished through ManipulationCompleted event in the IKinectController), but if I use a similar pattern for the carousel, the ScrollViewer inside the IKinectControl seems to capture the events and ManipulationCompleted for the parent element is never triggered.

    How can I access to low level interaction for a ScrollViewer? I don't know how KinectRegion handle interactions for child elements.

    • Edited by jmmroldan Friday, February 27, 2015 9:43 AM
    Friday, February 27, 2015 9:43 AM
  • The issue with that is you need to continue to bubble up the events to the children of the control. As Vincent posted on the thread, depending on what is going on at the IKinectControl level, you may need to add an additional event to trigger something down into the children.

    Carmine Sirignano - MSFT

    Friday, February 27, 2015 6:54 PM
  • If the hand is open,closed or moved in the children (ScrollViewer) area, parent (IKinectControl) events are not triggering so I cannot bubble them down. If I put an Image element inside IKinectControl instead of a ScrollViewer parent events trigger without problem. I suppose it has something to do with the default interaction that KinectRegion assigns to ScrollViewer (while there is no interaction with Images) but I cannot find a way to "override" it.
    Monday, March 2, 2015 9:37 AM