protected override void OnElementChanged (ElementChangedEventArgs<TableView> e) { base.OnElementChanged (e); if (e.NewElement == null) { this.GenericMotion -= HandleGenericMotion; this.Touch -= HandleTouch; } if (e.OldElement == null&& e.NewElement!=null) { gestureListener = new IndiGestureListener((TableView)e.NewElement); gestureDetector = new GestureDetector(gestureListener); this.GenericMotion += HandleGenericMotion; this.Touch += HandleTouch; } }
protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.ActivityIndicator> e) { base.OnElementChanged (e); if(GestureActuator.controlsToActuate .Contains<GestureActuator.ControlToActuate>(GestureActuator.ControlToActuate.ActivityIndicator)) { if (e.NewElement == null) { gestureListener = null; } if (e.OldElement == null&& e.NewElement!=null) { gestureListener = new IndiGestureListener(this.Control, e.NewElement); } } }
/// <summary> /// Method called when the underlying ViewElement Changes. /// </summary> /// <param name="e">Passes information about the element that changed.</param> protected override void OnElementChanged(ElementChangedEventArgs<ActivityIndicator> e) { base.OnElementChanged(e); if (GestureActuator.ControlsToActuate .Contains<GestureActuator.ControlToActuate>(GestureActuator.ControlToActuate.ActivityIndicator)) { if (e.NewElement == null) { this.GenericMotion -= this.HandleGenericMotion; this.Touch -= this.HandleTouch; } if (e.OldElement == null && e.NewElement != null) { this.gestureListener = new IndiGestureListener((ActivityIndicator)e.NewElement); this.gestureDetector = new GestureDetector(this.gestureListener); this.GenericMotion += this.HandleGenericMotion; this.Touch += this.HandleTouch; } } }