Xamarin.Forms Guides | Samples

Xamarin.Forms.View.GestureRecognizers Property

The collection of gesture recognizers associated with this view.


public IList<IGestureRecognizer> GestureRecognizers { get; }


A List of IGestureRecognizer.


Adding items to this collection will associate gesture events with this element. This is not nessesary for elements which natively support input, such as a Button.

This example creates a tap gesture recognizer and associates it with an image. When the image is double tapped, it will become semi-transparent.

C# Example

  var image = new Image {Source = "image.png"};
  var gestureRecognizer = new TapGestureRecognizer {
    TappedCallback = o => image.Opacity = 0.5,
    NumberOfTapsRequired = 2
  image.GestureRecognizers.Add (gestureRecognizer);


Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions:,,,,,,