问题
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