Xamarin.Forms                
            Gesto Xamarin
        
        
            
    Ricerca…
Tocca Gesto
Con il gesto del tocco, puoi rendere selezionabile qualsiasi elemento dell'interfaccia utente (immagini, pulsanti, impilati, ...):
(1) Nel codice, utilizzando l'evento:
var tapGestureRecognizer = new TapGestureRecognizer();
tapGestureRecognizer.Tapped += (s, e) => {
    // handle the tap
};
image.GestureRecognizers.Add(tapGestureRecognizer);
 (2) Nel codice, usando ICommand (con MVVM-Pattern , ad esempio): 
var tapGestureRecognizer = new TapGestureRecognizer();
tapGestureRecognizer.SetBinding (TapGestureRecognizer.CommandProperty, "TapCommand");
image.GestureRecognizers.Add(tapGestureRecognizer);
 (3) O in Xaml (con evento e ICommand , solo uno è necessario): 
<Image Source="tapped.jpg">
    <Image.GestureRecognizers>
        <TapGestureRecognizer Tapped="OnTapGestureRecognizerTapped" Command="{Binding TapCommand"} />
  </Image.GestureRecognizers>
</Image>
Modified text is an extract of the original Stack Overflow Documentation
        Autorizzato sotto CC BY-SA 3.0
        Non affiliato con Stack Overflow