Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

How to apply the TapGestureRecognizer in Xamarin form?

$
0
0

I have a picture A which this picture A when I single click on it it will show picture C, if I double click on the picture then it will show picture D.

Below is my code in xaml:


<Image.GestureRecognizers>

</Image.GestureRecognizers>

Below is my code in cs:

int tapCount;
void OnTapGestureRecognizerTapped(object sender, EventArgs args)
{

    var imageSender = (Image)sender;
    if (tapCount == 1)
    {
        imageSender.Source = "pictureC.png";
    }
    else if (tapCount == 2)
    {
        imageSender.Source = "pictureD.JPG";
    }
}

But above code does not work, anyone can share me ideas?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



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