| Start |
|---|
| Make an Image tappable by adding a TapGestureRecognizer There are a couple of default recognizers available in Xamarin.Forms, one of them is the You can add them to virtually any visual element. Have a look at a simple implementation which binds to an Or in XAML: Here the command is set by using data binding.
As you can see you can also set the Other gestures are Pinch and Pan. |
| Zoom an Image with the Pinch gesture In order to make an But it can also be done from XAML: In the accompanied event handler you should provide the code to zoom your image. Of course other uses can be implement as well. Other gestures are Tap and Pan. |
| Show all of the zoomed Image content with the PanGestureRecognizer When you have a zoomed This can be achieved by implementing the PanGestureRecognizer. From code this looks like so: This can also be done from XAML: In the code-behind event you can now handle the panning accordingly. Use this method signature to handle it: |
| Place a pin where the user touched the screen with MR.Gestures Xamarins built in gesture recognizers provide only very basic touch handling. E.g. there is no way to get the position of a touching finger.
MR.Gestures is a component which adds 14 different touch handling events. The position of the touching fingers is part of the If you want to place a pin anywhere on the screen, the easiest way is to use an As you can see the In your code behind you could add the Instead of the More samples for MR.Gestures can be found in the GestureSample app on GitHub (opens new window) and on the MR.Gestures website (opens new window). These also show how to use all the other touch events with event handlers, commands, MVVM, ... |
Read Article
https://develop.horje.com/learn/1434/reference