示例#1
0
 protected override void OnElementChanged(ElementChangedEventArgs <Xamarin.Forms.DatePicker> e)
 {
     base.OnElementChanged(e);
     if (GestureActuator.controlsToActuate
         .Contains <GestureActuator.ControlToActuate>(GestureActuator.ControlToActuate.DatePicker))
     {
         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 <Label> e)
        {
            base.OnElementChanged(e);
            if (GestureActuator.ControlsToActuate
                .Contains <GestureActuator.ControlToActuate>(GestureActuator.ControlToActuate.Label))
            {
                if (e.NewElement == null)
                {
                    this.GenericMotion -= this.HandleGenericMotion;
                    this.Touch         -= this.HandleTouch;
                }

                if (e.OldElement == null && e.NewElement != null)
                {
                    this.gestureListener = new IndiGestureListener((Label)e.NewElement);
                    this.gestureDetector = new GestureDetector(this.gestureListener);
                    this.GenericMotion  += this.HandleGenericMotion;
                    this.Touch          += this.HandleTouch;
                }
            }
        }