• Windows Phone 上拉刷新、下拉刷新


    ScrollViewer scrollViewer = new ScrollViewer();
    // 构造函数
    public MainPage()
    {
        InitializeComponent();
        for (int x = 0; x <= 30; x++)
        {
            listBox1.Items.Add(x);
        }
    }
    
    private double actuableOffset, validStartOffset;
    private bool mplStarted;
    protected override void OnManipulationStarted(ManipulationStartedEventArgs e)
    {
         base.OnManipulationStarted(e);
         mplStarted = true;
    }
    
    protected override void OnManipulationCompleted(ManipulationCompletedEventArgs e)
    {
         //150是下拉的距离可以自己调适
       if (actuableOffset > 150 && scrollViewer.VerticalOffset == 0)
        {
            MessageBox.Show("Head pull bingo!");
        }
        if (actuableOffset < -150 && scrollViewer.VerticalOffset == scrollViewer.ScrollableHeight)
        {
            MessageBox.Show("Tail pull bingo!");
        }
            base.OnManipulationCompleted(e);
    }
    
    protected override void OnMouseMove(MouseEventArgs e)
    {
        //head capture startRelative
        if (scrollViewer.VerticalOffset == 0)
        {
            if (mplStarted)
            {
                mplStarted = false;
                validStartOffset = e.GetPosition(null).Y;
             }
             actuableOffset = e.GetPosition(null).Y - validStartOffset;
         }
          //tail
          if (scrollViewer.VerticalOffset == scrollViewer.ScrollableHeight)
          {
              if (mplStarted)
              {
                  mplStarted = false;
                  validStartOffset = e.GetPosition(null).Y;
              }
              actuableOffset = e.GetPosition(null).Y - validStartOffset;
            }
            //UIControlHelper.FindFirst<Pivot>().Title = actuableOffset;
            base.OnMouseMove(e);
    }
  • 相关阅读:
    List分组和排序
    IOS 可靠性测试 iosMonkey
    Mac 10.10 下安装jdk 1.7 以上
    Ubuntu 无法拖拽复制
    Ubuntu 环境安装整理
    vmware 中 ubuntu linux 安装vmware tools
    Vmware linux 安装 Vmware Tools 提示只读
    Ubuntu_文件夹名字转化成英文
    Ubuntu_开启root 登陆
    Tomcat 用户配置
  • 原文地址:https://www.cnblogs.com/lihaibo-Leao/p/3141663.html
Copyright © 2020-2023  润新知