Beispiel #1
0
 public void RemoveRecognizer(BaseNativeGestureRecognizer recognizer)
 {
     NativeRecognizers.Remove(recognizer);
     if (GroupRecognizers.Contains(recognizer.Recognizer))
     {
         GroupRecognizers.Remove(recognizer.Recognizer);
     }
 }
Beispiel #2
0
        public void Destroy()
        {
            TargetView.PropertyChanged -= Recognizer_View_PropertyChanged;
            UnInitialize();

            //remove any remaining gesture recognizers;
            var recognizersToRemove = NativeRecognizers.ToArray();

            foreach (var recognizer in recognizersToRemove)
            {
                RemoveRecognizer(recognizer);
            }
        }
Beispiel #3
0
        public void AddRecognizer(BaseNativeGestureRecognizer nativeRecognizer)
        {
            NativeRecognizers.Add(nativeRecognizer);
            if (nativeRecognizer.Recognizer.View != TargetView)
            {
                throw new InvalidOperationException("tried to add recognizer to gesture coordinator that is associated with a different view");
            }
            nativeRecognizer.NativeView = _nativeView;
            var formsRecognizer = nativeRecognizer.Recognizer;

            if (formsRecognizer.IsConsumingTouchesInParallel && formsRecognizer.View is Xamarin.Forms.Layout <Xamarin.Forms.View> )
            {
                GroupRecognizers.Add(formsRecognizer);
            }
        }