2

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?

Tatu Ulmanen
  • 123,288
  • 34
  • 187
  • 185
  • Can this answer help you? http://stackoverflow.com/questions/11187382/get-listview-visible-items – michele Apr 29 '13 at 14:06

1 Answers1

0

Well I guess you have to fetch the inner ScrollViewer of the ListView, since I think the ScrollViewer is providing the scrolling behavior.
After you managed that, this post is probably going to help you.

Community
  • 1
  • 1
DHN
  • 4,807
  • 3
  • 31
  • 45