zoukankan      html  css  js  c++  java
  • 判断gridview 滑动到最右端 GIS

    首先获得girdview 里面的scrollviewer,

    private ChildType FindVisualChild<ChildType>(DependencyObject obj) where ChildType : DependencyObject
    {
    //if (obj != null)
    //{
    for (int i = 0; i < VisualTreeHelper.GetChildrenCount(obj); i++)
    {
    DependencyObject child = VisualTreeHelper.GetChild(obj, i);
    if (child != null && child is ChildType)
    return child as ChildType;
    else
    {
    ChildType childOfChild = FindVisualChild<ChildType>(child);
    if (childOfChild != null)
    return childOfChild;
    }
    }
    //}
    return null;
    }

    然后注册scrollviewer 的ViewChanged 事件

    然后比较 if (pScrollViewer.ScrollableWidth - pScrollViewer.HorizontalOffset < 50),

    void obj2_ViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
    {
    ScrollViewer pScrollViewer = (ScrollViewer)sender;
    if (pScrollViewer.ScrollableWidth - pScrollViewer.HorizontalOffset < 50)
    {
    for (int i = 0; i < 20; i++)
    {
    _hotZoneList.Add(new AdProduct() { productName = "nokia", productDesc = "摩托双核双模双待明星机型…", partNum = i.ToString(), productCode = "68999999999999966" + i.ToString(), productImage = "http://cosmeticsfile.ifeng.com/datas/uploadimage/try/201209/20120903094035563.jpg", productPrice = "$65" + i.ToString() });
    }
    }

    else

    {
    return;
    }
    }

    在VariableSizedWrapGrid_Loaded_1事件获得可视子元素

  • 相关阅读:
    ssi服务器端指令
    json格式的转换为json字符串函数
    接口测试基础和jmeter
    【JZOJ6274】梦境
    【JZOJ6275】小L的数列
    【luoguP4721】分治 FFT
    【luoguP3868】猜数字
    中国剩余定理与扩展中国剩余定理
    【JZOJ6277】矩阵游戏
    【JZOJ6271】锻造 (forging)
  • 原文地址:https://www.cnblogs.com/gisbeginner/p/2688453.html
Copyright © 2011-2022 走看看