Tap and Click Events

Since the release of the Windows Phone 7.1 SDK, the Click event of the ButtonBase class has been superseded by a UIElement event named Tap. The Tap event is designed for touch input, while the Click event relies on legacy code that handles mouse state.

Note

While the ButtonBase Click event is still present in the SDK, unless your UI code needs to be shared with Silverlight for the browser projects, use the Tap event.

The following is an example of a UIElement.Tap event handler.

void Button_Tap(object sender, System.Windows.Input.GestureEventArgs e){...}

Note

There is another public GestureEventArgs class residing in the Windows Phone Toolkit that is, unfortunately, located in the Microsoft.Phone.Controls ...

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.