Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

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 = "" };

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.