예제 #1
0
        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();
                }
            }
        }
예제 #2
0
        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();
                }
            }
        }