PointerPressed
PointerPressed is a high level function that will be triggered before any control clicked / touched gets their Tapped event.
using Windows.UI.Core;
Add to the Page_Loading
//----- REGISTER FOR THE POINTER PRESSED EVENT SO WE GET ALL SCREEN TOUCHES / CLICKS -----
Window.Current.CoreWindow.PointerPressed += CoreWindow_PointerPressed;
Add to the Page_Unloaded
Window.Current.CoreWindow.PointerPressed -= CoreWindow_PointerPressed;
Method that will be called
//******************************************
//******************************************
//********** PAGE HAS BEEN TAPPED **********
//******************************************
//******************************************
//Will occur for any touch or click anywhere on the page
private void CoreWindow_PointerPressed(Windows.UI.Core.CoreWindow sender, Windows.UI.Core.PointerEventArgs args)
{
try
{
//Flag that keypress has been handled (to stop it repeating forever)
args.Handled = true;
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("Exception: " + ex.Message);
}
}
Feel free to comment if you can add help to this page or point out issues and solutions you have found. I do not provide support on this site, if you need help with a problem head over to stack overflow.