简体   繁体   English

Windows Phone 8.1通用应用程序:ManipulationCompleted事件不会触发

[英]Windows Phone 8.1 Universal Apps: ManipulationCompleted event doesn't fire

I'm writing a universal application for WP8.1 and W8.1. 我正在为WP8.1和W8.1编写通用应用程序。

I have a Rectangle in my XAML: 我的XAML中有一个矩形:

<Rectangle 
    Fill="Tomato"
    Width="300"
    Height="300"
    ManipulationMode="All"
    ManipulationStarting="UIElement_OnManipulationStarting"
    ManipulationCompleted="UIElement_OnManipulationCompleted"
/>

But ManipulationCompleted fires only if I do some movement across rectangle. 但是,仅当我在矩形上进行一些移动时,ManipulationCompleted才会触发。 If I do just simple tap, then only ManipulationStarting fires. 如果我只做简单的点击,那么只有ManipulationStarting会触发。

What's wrong? 怎么了?

I used PointerReleased event instead of ManipulationCompleted event. 我使用了PointerReleased事件而不是ManipulationCompleted事件。 It happens when you release your finger from Rectangle. 当您从矩形松开手指时,会发生这种情况。

Also you can use PointerCaptureLost event. 您也可以使用PointerCaptureLost事件。

First off, you need to set the ManipulationDelta event, in order to do some drag and drop. 首先,您需要设置ManipulationDelta事件,以便进行一些拖放。 ManipulationDelta is raised when a second touch point is placed on the UIElement and when this touch point changes position. 当第二个接触点放置在UIElement上并且此接触点更改位置时,将提高ManipulationDelta

The ManipulationCompleted event is raised when the user leaves his finger or fingers from the UIElement and when any inertia applied to the element is complete. 当用户将一个或多个手指从UIElement上移开并且施加到该元素的惯性完成时,将引发ManipulationCompleted事件。 If you only have one touching point with a single tap, like you describe, no movement takes place, no velocities are applied and no manipulation happened in the first place. 如您所描述的,如果您只有一个触碰点,那么就不会发生移动,没有施加速度并且首先不会进行任何操作。

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

相关问题 ListView ManipulationCompleted事件在手机上不起作用 - ListView ManipulationCompleted event doesn't work on phone XmlResolver在Windows Phone 8.1 Universal Apps中不起作用 - XmlResolver is not working in Windows Phone 8.1 Universal Apps 如何在Windows Phone 8中处理ManipulationCompleted事件? - How to handle ManipulationCompleted event in windows phone 8? 集线器磁贴(在应用程序磁贴中)Windows Phone 8.1(通用应用程序) - Hub Tiles (In App Tiles) Windows Phone 8.1 (Universal Apps) ContentLength in不适用于Windows Phone 8.1 Universal Apps中的HttpWebRequest - ContentLength in Not available for HttpWebRequest in Windows Phone 8.1 Universal Apps 在退出Windows Phone 8.1(通用应用程序)上保存数据 - Save data on exit Windows Phone 8.1 (Universal Apps) 如何在Windows Phone 8.1 Universal Apps中创建CycleTile - How To Create CycleTile in Windows Phone 8.1 Universal Apps FileSavePicker for Audio文件在Windows Phone 8.1 Universal Apps中不起作用 - FileSavePicker for Audio file is not working in Windows Phone 8.1 Universal Apps Windows Phone 8.1通用应用程序中不存在NotifyComplete&Abort方法 - NotifyComplete & Abort Methods are not existing in Windows Phone 8.1 Universal Apps 如何在Windows Phone 8.1通用应用程序中使用搜索框控件? - How to use search box control in Windows Phone 8.1 universal apps?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM