Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Disable second tap on Image

$
0
0

Hi All,

I have an image where i am handling the click event using gestures. Example Below.

XAML CODE

    <Image Source="info.png" HeightRequest="20" WidthRequest="20">
            <Image.GestureRecognizers>
              <TapGestureRecognizer Tapped="OnTap" />
            </Image.GestureRecognizers>
    </Image>

CODE

    private void OnTap(object sender, EventArgs e)
            {
                    var resultTextView = new GenericListView("Result View");
                    Application.Current.MainPage.Navigation.PushAsync(resultTextView);
                }
            }

This works. But if user clicks on the image multiple times, then the tap event is called multiple times. I want it to be called only once.

How do i fix this?

Thank you.

Regards,
Manoj


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>