-->

Save scroll position of LongListSelector control i

2019-07-20 06:34发布

问题:

I need to save LongListSelector position in order to restore it once I get back to the page. First I used GetItemsInView with WP7 and it works great. Then with WP8 it was gone and I have to use ItemRealized. It also works fine but I have side effect which that ItemRealized gives me the item which is at the bottom of current page (it could be even not visible yet).

But what I need is to scroll to the item at the top of the page. I could subtract manually items which are visible (by calculating item height and page height) but because the realized item could be not visible yet (that means my calculation logic will not be correct) I couldn't be sure that I chosen the right element.

Is there a way to find the first visible item in the view at LongListSelector?