windows phone开发之 listbox分页加载数据
2012-01-11 11:44
204 查看
private void listbox1_MouseMove(object sender, MouseEventArgs e) { if (Result[0] == "1") { //获取listbox的子类型ScrollViewer ScrollViewer scrollViewer = FindChildOfType<ScrollViewer>((ListBox)sender); if (scrollViewer == null) { throw new InvalidOperationException("erro"); } else { //判断当前滚动的高度是否大于或者等于scrollViewer实际可滚动高度,如果等于或者大于就证明到底了 if ((scrollViewer.VerticalOffset + 1) >= scrollViewer.ScrollableHeight) { MessageBox.Show("aaa"); } } } } //获取子类型 public static T FindChildOfType<T>(DependencyObject root) where T : class { var queue = new Queue<DependencyObject>(); queue.Enqueue(root); while (queue.Count > 0) { DependencyObject current = queue.Dequeue(); for (int i = VisualTreeHelper.GetChildrenCount(current) - 1; 0 <= i; i--) { var child = VisualTreeHelper.GetChild(current, i); var typedChild = child as T; if (typedChild != null) { return typedChild; } queue.Enqueue(child); } } return null; }
相关文章推荐
- Windows Phone开发之 listbox分页加载数据
- windows phone开发学习--Pivot动态加载数据
- Windows Phone开发经验谈(18)-总结两种滚动条到底部加载数据的方法
- WEB开发 Scroll 滚动条 加载数据
- Windows Phone开发(14):数据模板
- Windows Phone 8初学者开发—第12部分:改进视图模型和示例数据
- selenium自动化测试工具开发python爬虫-动态加载页面数据获取
- Windows Phone 开发学习笔记(十) RSS阅读器之解析数据
- 《深入浅出Windows Phone 8应用开发》之手机存储卡数据
- iOS开发-UIWebView加载本地和网络数据
- Ruby on rails开发从头来(四十九)- ActiveRecord基础(行数和再加载数据)
- Windows Phone开发(14):数据模板
- Windows phone Piovt数据加载模式
- Android 应用开发 之通过AsyncTask与ThreadPool(线程池)两种方式异步加载大量数据的分析与对比
- Windows Phone 开发学习笔记(十一) RSS阅读器之显示数据
- Windows Phone实用开发技巧(1):保存图片及加载图片
- Windows Phone 7 开发探索笔记7——加载XML文件
- 安卓开发之ListView(HorizontalListView)横向动态加载数据例子
- Ruby on rails开发从头来(四十九)- ActiveRecord基础(行数和再加载数据)
- windows phone开发学习--加载时的旋转动画