Reputation: 1274
How do we detect a scrolling event in GridView (like ViewChanged on ScrollViewer) on somethig like the default GridView template sample app? I'd like to replicate the effect that the netflix App does on the left red strip.
I tried putting the GridView inside a scrollviewer, but I've been unsuccessful at stretching it to fill the screen for different resolutions.
Update: I intend to use this with VariableGrid control that's on NuGet - though it's not an official control, it inherits GridView
Upvotes: 3
Views: 4240
Reputation: 1522
There is a simpler way.
Edit a template of the GridView, and look inside the XAML to find a ScrollViewer
which is a component of the GridView.
The ScrollViewer
has a ViewChanged
event that you can subscribe to. Now whenever the GridView is scrolled, this event will be fired.
Upvotes: 1
Reputation: 1274
The best way to do this seems that you can read through the components of the control, and assign events to it. based on what's happening in this example
I grabbed access to the scrollbar, suing the VisualTreeExtensions and I could capture the event Scroll, just like in the example. I had to read the children when the Loaded event of the grid was fired.
Upvotes: 1
Reputation: 3046
Try ManipulationCompleted and PointerReleased events on GridView. This is just using keyboard mouse..
Upvotes: 0