Save scroll position of LongListSelector control in Windows Phone 8

人走茶凉 提交于 2019-12-24 02:04:55

问题


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?

来源:https://stackoverflow.com/questions/23226370/save-scroll-position-of-longlistselector-control-in-windows-phone-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!