繁体   English   中英

在Windows Phone 8的枢轴控件内滑动时如何检测水平变化

[英]how to detect the horizontal change when swiping inside a pivot control in windows phone 8

我想在Windows Phone 8的枢轴控件内滑动时检测水平变化,以便可以对绑定到控件的集合进行更改,例如在向左或向右滑动时添加或删除项目。 我想要除selectionchanged事件以外的其他东西,因为我在那里遇到了一些问题。

尝试这个:

public TakeTourPage()
{
    InitializeComponent();
    GestureListener gestureListener = GestureService.GetGestureListener(ContentPanel);
    gestureListener.DragCompleted += gestureListener_DragCompleted;
}

void gestureListener_DragCompleted(object sender, DragCompletedGestureEventArgs e)
{

    // User flicked towards left
    if (e.HorizontalVelocity < 0)
    {
    }

    // User flicked towards right
    if (e.HorizontalVelocity > 0)
    {
    }
 }

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM