C#Windows Phone 7的框滚动up / down事件? [英] C# Windows Phone 7 ListBox Scrolling Up / Down event?

查看:201
本文介绍了C#Windows Phone 7的框滚动up / down事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要寻找一个办法知道当用户滚动在我的Windows Phone 7应用程序向上或向下的列表框。

I am looking for a way to know when a user is scrolling the listbox on my Windows Phone 7 application up or down.

我能来最接近

    private double fDown = 0.6;

    private void buddyList_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
    {
        var sView = e.ManipulationContainer as ScrollViewer;

        double lBox = 25 - fDown;

        double nBox = 25 - sView.VerticalOffset;

        if (nBox > lBox)
            MessageBox.Show("up!");
        else
            MessageBox.Show("down!");
    }



不过,这并不正常工作。我需要知道什么时候它是在比较,通过它的中间滚动列表框的底部。

However, that doesn't work correctly. I need to know when it's at the bottom of the listbox compared to scrolling through the middle of it.

当它在列表框的底部,我想启用定时器以保持它在底部不断。还是有另一种方式来保持它在不断地底......?有反正我可以做到这一点?

When it's at the bottom of the listbox I want to enable a timer to keep it at the bottom constantly. Or is there another way to keep it at the bottom constantly...? Is there anyway I can do this?

感谢。

推荐答案

我跟一个朋友,他给了我这个作为一个答案(的人谁在futue看起来):

I talked to a friend and he gave me this as an answer (to anyone who looks in the futue):

        var sView = e.ManipulationContainer as ScrollViewer;

        double lBox = 25 - sView.ScrollableHeight;

        double nBox = 25 - sView.VerticalOffset;

        if (lBox < nBox)
            //Listbox Scrolled Up
        else
            //Listbox at Bottom

感谢。

这篇关于C#Windows Phone 7的框滚动up / down事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆