TouchFrameEventArgs.SuspendMousePromotionUntilTouchUp Method

July 28, 2014

Disables automatic mouse-event promotion for the primary touch point until all touch points report as Up.

Namespace:  System.Windows.Input
Assembly:  System.Windows (in System.Windows.dll)

public void SuspendMousePromotionUntilTouchUp()

ExceptionCondition
InvalidOperationException

No primary touch point was recorded.

-or-

The primary touch point has an action other than Down.

Mouse-event promotions restart after a primary touch down if they are not suspended again.

You might call this method if you are sure that the client has full multi-touch capabilities. You can determine multi-touch capabilities through user-agent checks or other techniques that are available in the hosting environment.

This method enables you to cancel mouse-event promotion on a per-event basis, which is appropriate because the method exists in event data. Also, some input-capable surfaces in your Windows Phone application might not be touch-enabled. Some sources, such as a button, might still need mouse promotion to work as expected. If you want to cancel mouse-event promotion for a longer period, such as a session or the application lifetime, you can routinely call SuspendMousePromotionUntilTouchUp for all registered touch-event handlers.

Touch input requires hardware that is touch-sensitive and an environment that supports the infrastructure that exposes touch events to individual applications. The need for mouse-event promotion is often related to how you handle the client cases where touch or multi-touch is not supported.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2014 Microsoft