private void CheckLoadNewData() { var scrollViewer = ItemList.GetChildOfType <ScrollViewer>(); // Load next results when scrollviewer is at the bottom if (scrollViewer?.ScrollableHeight > 0) { // Query next page when reaching more than 99% of the scrollable content. if ((scrollViewer.VerticalOffset / scrollViewer.ScrollableHeight) > 0.99d) { _ = viewModel.LoadMoreData(); } } }
private void ScrollViewer_ScrollChanged(object sender, ScrollChangedEventArgs e) { var scrollViewer = ItemList.GetChildOfType <ScrollViewer>(); // Load next results when scrollviewer is at the bottom if (scrollViewer?.ScrollableHeight > 0) { // Query next page when reaching more than 80% of the scrollable content. if ((scrollViewer.VerticalOffset / scrollViewer.ScrollableHeight) > 0.8d) { viewModel.LoadMoreData(); } } }