wp listbox分页加载
来源:互联网 发布:淘宝流量怎么看 编辑:程序博客网 时间:2024/05/21 21:35
private void InitialControl(ListBox listbox)
{
List<ScrollBar> scrollBarList = GetVisualChildCollection<ScrollBar>(listbox);
foreach (ScrollBar scrollBar in scrollBarList)
{
if (scrollBar.Orientation == System.Windows.Controls.Orientation.Horizontal)
{
}
else
{
scrollBar.ValueChanged -= new RoutedPropertyChangedEventHandler<double>(verticalScrollBar_ValueChanged);
scrollBar.ValueChanged += new RoutedPropertyChangedEventHandler<double>(verticalScrollBar_ValueChanged);
}
}
}
private void verticalScrollBar_ValueChanged(object sender, RoutedEventArgs e)
{
ScrollBar scrollBar = (ScrollBar)sender;
object valueObj = scrollBar.GetValue(ScrollBar.ValueProperty);
object maxObj = scrollBar.GetValue(ScrollBar.MaximumProperty);
if (valueObj != null && maxObj != null)
{
double value = (double)valueObj;
double max = (double)maxObj - 1.0;
if (value >= max)
{
//读取下一页的数据
pageIndex++;
BindNews(currentListBox, currentType, 5, pageIndex);
}
}
}
public static List<T> GetVisualChildCollection<T>(object parent) where T : UIElement
{
List<T> visualCollection = new List<T>();
GetVisualChildCollection(parent as DependencyObject, visualCollection);
return visualCollection;
}
private static void GetVisualChildCollection<T>(DependencyObject parent, List<T> visualCollection) where T : UIElement
{
int count = VisualTreeHelper.GetChildrenCount(parent);
for (int i = 0; i < count; i++)
{
DependencyObject child = VisualTreeHelper.GetChild(parent, i);
if (child is T)
{
visualCollection.Add(child as T);
}
else if (child != null)
{
GetVisualChildCollection(child, visualCollection);
}
}
}
- wp listbox分页加载
- Windows Phone ListBox的分页加载
- WP 虚拟ListBox
- wp listbox遍历办法
- wp清空listbox内容
- Windows Phone开发之 listbox分页加载数据
- 【Windows Phone】 001.ListBox滑动到底分页加载
- wp-pagenavi分页导航
- WP ListBox 遍历DataTemplate(获取所有控件)
- WP--listBox选中项颜色改变
- JS ListBox动态加载数据
- WP7 ListBox滚动加载数据
- WPF ListBox异步加载图片
- WP-PageNavi分页插件的使用
- 分页加载
- 分页加载
- 分页加载
- 分页加载
- 私有IP 地址块
- 实现自己的LUA绑定器-一个模板编程挑战
- 动态规划——国王挖掘金矿
- c#按钮打开目录或文件名
- 视频监控/存储系统设计要点
- wp listbox分页加载
- 缓冲运动-2-[解决1] -.html
- ListView的性能优化之convertView和viewHolder
- Invoke和BeginInvoke的真正含义
- cocos2d-x CCScrollView和CCTableView的使用
- Codeforces Round #274 (Div. 2) D
- WAP/HTML5 手机拨号链接&发送短信
- openfire 新手笔记 (二) openfire的安装
- 缓冲运动-2-多个div淡入淡出[问题].html