This project is read-only.

List View Item Position

Oct 7, 2014 at 4:37 PM

I'm using a databound listview in my WinRT (Universal) app and would like to know if this toolkit can help me find what item is currently at the top of the list, (in view) so I can save it and return to this position the next time the app is run!!
Oct 7, 2014 at 4:59 PM
Nope, this functionality is not available..
I think ill add methods to get and restore the scroll position (not top item). But currently i dont have the time.,
Oct 7, 2014 at 5:20 PM
OK, Thanks.

I'm using VisualTreeHelper extension from another toolkit to try and build this functionality.
Oct 8, 2014 at 8:51 AM
Hi, saving/restore scroll position may have odd effect if value is passed between devices. i.e. 500px down on a Win Phone, might not be 500px down on a Win Table?? I'm not sure, just guessing really..
Oct 8, 2014 at 8:53 AM
You are right, in this scenario you need to store an item id... I thought about saving the scroll pos for saving app state for app suspend/resume...
Oct 8, 2014 at 9:57 AM
That's a good idea too!!
Oct 8, 2014 at 4:10 PM
Ok, just created these classes:

Also have a look at these extension methods to get scrolling positions:

You need to download or clone the latest source code from the "source code" as it is not yet available on NuGet...
Oct 8, 2014 at 4:14 PM
Edited Oct 8, 2014 at 4:17 PM
You also should test the performance of the GetVisibleItems and GetFirstVisibleItem method as I'm not sure how it behaves when having lots of items in a list.