Because Hold And Tap Event is not available in UWP so i am using Tapped And Holding event in UWP.
for Windows phone 8 apps i am using tap hand hold event for button. where when i hold a button tap event is not fire.
but in UWP i tried Click and Tapped event but both fires when i hold button.
please suggest me other method where other event should not fire when i hold a button Holding Event here is necessary, suggest me alternate of Tapped and click event because these event fires when i hold and release a button
XAML
<StackPanel Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center">
<Button Name="BackwardButton"
FontFamily="Segoe MDL2 Assets" Content=""
FontSize="30" Background="Transparent"
Tapped="BackwardButton_Tapped" Holding="BackwardButton_Holding"
PointerExited="BackwardButton_PointerExited"/></StackPanel>
<TextBlock Name="txtBox1" FontSize="18"
HorizontalAlignment="Center" VerticalAlignment="Bottom"/>
C#
private static int i;
private void BackwardButton_Tapped(object sender, TappedRoutedEventArgs e)
{
i++;
txtBox1.Text = i.ToString();
}
private int a = 10;
private void BackwardButton_Holding(object sender, HoldingRoutedEventArgs e)
{
BackwardButton.Content = "\xE100";
try
{
a++;
txtBox1.Text = a.ToString();
}
catch (Exception)
{
//Exception(ex);
}
}
private void BackwardButton_PointerExited(object sender, PointerRoutedEventArgs e)
{
BackwardButton.Content = "\xE26C";
}
Solutions i already tried- https://social.msdn.microsoft.com/Forums/en-US/e386e2e8-0312-4b1e-8eea-9522db83d632/click-and-tapped-event-should-not-fire-when-holding-event-perform?forum=wpdevelop
And solution tried on windows 8 but hold and tap event not available in UWP Click Event should not trigger when hold event perform