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?

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top