C# 如何在windows phone 8中处理操纵完成事件?

C# 如何在windows phone 8中处理操纵完成事件?,c#,windows-phone-8,C#,Windows Phone 8,我有下面的代码,但它不工作,谁能建议我需要做什么样的更改,以使其工作 Mainscroll.ManipulationCompleted += new EventHandler<System.Windows.Input.ManipulationCompletedEventArgs>(Mainscroll_completed); private void Mainscroll_completed(object sender, System.Windows.Input.Manipulat

我有下面的代码,但它不工作,谁能建议我需要做什么样的更改,以使其工作

Mainscroll.ManipulationCompleted += new EventHandler<System.Windows.Input.ManipulationCompletedEventArgs>(Mainscroll_completed);
 private void Mainscroll_completed(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
        {
            UIElement target = sender as UIElement;
            target.AddHandler(UIElement.ManipulationCompletedEvent, new EventHandler(layoutroot), true);
           // throw new NotImplementedException();
        }

        private void layoutroot(object sender, EventArgs e)
        {
            MessageBox.Show("done");
        }
maincroll.operationcompleted+=新事件处理程序(maincroll\u已完成);
private void Main Scroll_已完成(对象发送方,System.Windows.Input.OperationCompletedEventArgs e)
{
UIElement目标=发送方作为UIElement;
target.AddHandler(UIElement.operationCompletedEvent,新的EventHandler(layoutroot),true);
//抛出新的NotImplementedException();
}
私有void layoutroot(对象发送方、事件参数)
{
MessageBox.Show(“完成”);
}
替换此行:

Mainscroll.ManipulationCompleted += 
    new EventHandler<System.Windows.Input.ManipulationCompletedEventArgs>(Mainscroll_completed);
this.Mainscroll.AddHandler(
    Pivot.ManipulationCompletedEvent, 
    new EventHandler<ManipulationCompletedEventArgs>(Mainscroll_completed), true);

完全不清楚你想实现什么,什么不起作用。为什么要调用
target.AddHandler…
?当我们滚动时,我想处理滚动末尾的事件。我想知道当我到达滚动的末尾时,处理哪个滚动事件,这样我就可以处理Scollviewer的操纵完成事件。我正在为windows 8 phone使用这些代码,我在网络上读到,如果操作完成不起作用,那么我们必须使用target.Addhandler。
target.AddHandler(UIElement.ManipulationCompletedEvent......