实现方式:当滑动条触底时,加载数据
xaml代码: <ListView ScrollViewer.ScrollChanged="ListView_ScrollChanged"></ListView> //事件代码 private void ListView_ScrollChanged(object sender, RoutedEventArgs e) { ScrollViewer viewer = e.OriginalSource as ScrollViewer; if (viewer == null) return; double bottomOffset = viewer.ExtentHeight - viewer.VerticalOffset - viewer.ViewportHeight; if (viewer.VerticalOffset > 0 && bottomOffset == 0) { //to do } }
这是一个附加事件:
ScrollViewer.ScrollChanged,代码只能提示不会提示,不止事件拼写的话,可直接查看msdn