Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 89864

MR.Gestures handles ALL touch gestures

$
0
0

With MR.Gestures you can handle the Tapping, Tapped, DoupleTapped, LongPressing, LongPressed, Panning, Panned, Swiped, Pinching, Pinched, Rotating and Rotated gestures on all layouts, cells, views and on the ContentPage.

The code can be as easy as

    var box1 = new MR.Gestures.BoxView { Color = Color.Red };
    box1.LongPressed += (s, e) => { Console.WriteLine("Code: Red LongPressed"); };

Or in XAML


<mr:ContentView xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:mr="clr-namespace:MR.Gestures;assembly=MR.Gestures" x:Class="GestureSample.Views.ContentViewXaml" Padding="50" TappingCommand="{Binding TappingCommand}" TappedCommand="{Binding TappedCommand}" DoubleTappedCommand="{Binding DoubleTappedCommand}" LongPressingCommand="{Binding LongPressingCommand}" LongPressedCommand="{Binding LongPressedCommand}" PanningCommand="{Binding PanningCommand}" PannedCommand="{Binding PannedCommand}" SwipedCommand="{Binding SwipedCommand}" PinchingCommand="{Binding PinchingCommand}" PinchedCommand="{Binding PinchedCommand}" RotatingCommand="{Binding RotatingCommand}" RotatedCommand="{Binding RotatedCommand}" >

MR.Gestures is available via NuGet. More info on http://www.mrgestures.com/.

There is also a sample app available to download from https://github.com/MichaelRumpler/GestureSample. The GestureSample demonstrates how to use all the gestures with all Xamarin.Forms elements.


Viewing all articles
Browse latest Browse all 89864

Trending Articles