Reaching bottom of ScrollViewer - maximum VerticalOffset value is lower than ScrollableHeight

[亡魂溺海] 提交于 2019-12-11 03:47:19

问题


I have problem with detecting when user reached the bottom of a ScrollViewer.

My Code:

bool atBottom = scrollViewer.VerticalOffset >= scrollViewer.ScrollableHeight;

But sometimes when I reached the bottom of Scrollviewer, value of scrollViewer.VerticalOffset is lower than scrollViewer.ScrollableHeight. It depends on items in listbox, but I dont know how.

Do you know, where is the problem?


回答1:


You shouldn't use this approach to detect reaching the bottom of the scrollviewer. Instead you should use the Scroll states to detect this.

See http://blogs.msdn.com/b/slmperf/archive/2011/06/30/windows-phone-mango-change-listbox-how-to-detect-compression-end-of-scroll-states.aspx



来源:https://stackoverflow.com/questions/10774462/reaching-bottom-of-scrollviewer-maximum-verticaloffset-value-is-lower-than-scr

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