Search code examples
c#xamlwindows-runtimewindows-phonewindows-store-apps

How to decrese the time Holding event occurs?


I want the Holding event occur quicker, by default it takes around 2 seconds to occur:

<Grid Holding="Grid_Holding">

</Grid>

Couldn't find a solution in the documentation. I think I need to change states somehow in Blend!

How to decrese the time holding event occurs? thanks.


Solution

  • It doesn't seem you can change this time threshold! It should be, at max, a user setting (not an application setting). According to the Reference here, this is what define the Holding event:

    The Tapped, DoubleTapped, and RightTapped events occur only after the touch point is removed. But the initial Holding event occurs while the touch point is still in contact. The event occurs if the touch point remains in approximately the same PointerPoint position for a period of time. The exact timing of what the system interprets as a holding action is adjustable by users through system settings.

    http://msdn.microsoft.com/en-US/library/windows/apps/windows.ui.xaml.uielement.holding.aspx

    Also, from the same reference:

    Tapped and Holding are mutually exclusive. If the action passes the time threshold to be considered a Hold action, it's not considered to be a Tap action also.

    Wouldn't you prefer to subscribe to Tap event instead, or maybe both? So you would monitor when it happens fast and slow.

    http://msdn.microsoft.com/en-US/library/windows/apps/windows.ui.xaml.uielement.tapped.aspx