I'd like to subscribe to an event which tells me that scrolling has started in a ListView and get the direction of scrolling.
Is there any way to do this in Windows 10 UWP API?
Thanks
I'd like to subscribe to an event which tells me that scrolling has started in a ListView and get the direction of scrolling.
Is there any way to do this in Windows 10 UWP API?
Thanks
You should first obtain the
ScrollViewer
inside theListView
and then subscribe to itsDirectManipulationStarted
event.However, to get the direction of the scrolling can be tricky. I'd suggest you to have a look at the new Windows Composition API where there's a way to use
ExpressionAnimation
to link theScrollViewer
's translation to a value of your choice.A good start is to have a look at this demo from James Clarke.
Update
Actually just thought of an easier way to detect the scrolling direction. Just subscribe whenever the
VerticalOffset
is changed and compare it to its previous values.