Reaching bottom of ScrollViewer - maximum VerticalOffset value is lower than ScrollableHeight
-
11-06-2021 - |
Question
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?
Solution
You shouldn't use this approach to detect reaching the bottom of the scrollviewer. Instead you should use the Scroll states to detect this.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow