Пример #1
0
 void AddSomeGesturesUsingCode()
 {
     //2 options:
     //1. use the standard xamarin api. e.g. view.GestureRecgonizers.Add(yourgesturerecognizer)
     //    and then call view.ProcessGestures();
     //    this has the benefit that when Xamarin add an api hook we can remove the view.ProcessGestures call and
     //    it will all be good.
     //2. use the extension method view.AddGestureRecognizer(yourgesturerecognizer)
     //    this is easier to use; and does everything under the hood; but it's a bit more obtrusive.
     //   in all cases, until Xamarin do more to open up the api, you must use the view extension method
     //   removeGestureRecognizer
     // comment on https://bugzilla.xamarin.com/show_bug.cgi?id=30467 to get Xamarin to expand
     // IGestureRecognizer with some add/remove hooks
     _stackPanRecognizer           = new PanGestureRecognizer();
     _stackPanRecognizer.OnAction += OnAction;
     MyStack.AddGestureRecognizer(_stackPanRecognizer);
 }