Xamarin TapGestureRecognizers - how to get View object data

AbhiNilAbhiNil CAMember ✭✭✭
edited January 2017 in Xamarin.Forms

Hey guys ,

I created several image objects and added a gesture recognizer to each of them .

var image = new Image { Source = "www.photokkk.com/image.png" };

When i click the image , i want to retrieve the Source url . How can i achieve that ?

    public async void ImageTapped(object sender, EventArgs e)
            await DisplayAlert("Alert", "Image cliked!", "OK");

        //var x = e.Source;
        //await DisplayAlert("Alert", x , "OK");

Best Answer


  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭
    I think there is a mistake. You add MediatapGestureRecognizer but you have defined ImageRapped...

    Btw you should take a look to sender object in your GestureRecognizet
Sign In or Register to comment.