I have a fairly standard ListView with a GridView:
<ListView x:Name="ListViewProducts" ItemsSource="{Binding Products}">
<ListView.View>
<GridView>
<GridViewColumn Header="Id" Width="50" DisplayMemberBinding="{Binding Id}"/>
<GridViewColumn Header="Name" Width="200" DisplayMemberBinding="{Binding Name}"/>
</GridView>
</ListView.View>
</ListView>
I'd like to implement infinite scrolling to this ListView, where new items would be loaded as soon as the user scrolls to the bottom of the list. I've tried to get the ScrollViewer of ListView using VisualTreeHelper but ListViewProduct apparently has no children:
VisualTreeHelper.GetChildrenCount(ListViewProducts) // Gives 0
Because the count of children is 0, answers like this won't work: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/794815aa-9a1e-4b57-b097-71d8672f331b/.
How can I detect when the user has scrolled to the bottom of the ListView?