简体   繁体   中英

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

I'm writing a universal application for WP8.1 and W8.1.

I have a Rectangle in my 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. If I do just simple tap, then only ManipulationStarting fires.

What's wrong?

I used PointerReleased event instead of ManipulationCompleted event. It happens when you release your finger from Rectangle.

Also you can use PointerCaptureLost event.

First off, you need to set the ManipulationDelta event, in order to do some drag and drop. ManipulationDelta is raised when a second touch point is placed on the UIElement and when this touch point changes position.

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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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