예제 #1
0
        public void HandlePointerInput(
            PointerInputEvent inputEvent,
            ref GestureEventResult result)
        {
            if (inputEvent.State == PointerInputState.Began)
            {
                this._delegate.OnTouchBegan();
            }
            else if (inputEvent.State == PointerInputState.Ended)
            {
                this._delegate.OnTouchEnded();
            }
            else if (inputEvent.State == PointerInputState.Canceled)
            {
                this._delegate.OnTouchCanceled();
            }

            this.OnPointerInput(inputEvent, ref result);

            if ((this.State == GestureState.Recognized) ||
                (this.State == GestureState.Failed) ||
                (this.State == GestureState.Canceled))
            {
                // Reset on reaching a terminal node in the state machine
                this.Reset();
            }
        }
예제 #2
0
        private bool HandleLightDismissEvent(
            View view,
            PointerInputEvent pointerInputEvent)
        {
            bool handled = false;

            if (pointerInputEvent.State == PointerInputState.Began)
            {
                LightDismissControl lightDismissControl = this.LightDismissControl;
                if (null != lightDismissControl)
                {
                    if (!lightDismissControl.HasDescendant(view))
                    {
                        // Invoke light dismiss
                        lightDismissControl.OnLightDismiss();

                        this.LightDismissControl = null;

                        handled = true;
                    }
                }
            }

            return(handled);
        }
예제 #3
0
        public virtual bool HandlePointerEvent(
            PointerInputEvent pointerInputEvent)
        {
            if (this.Application.HandlePreviewInput(this, pointerInputEvent))
            {
                return(true);
            }

            GestureEventResult result = new GestureEventResult();

            this.GestureRecognizer?.HandlePointerInput(pointerInputEvent, ref result);
            return(result.DidHandleEvent);
        }
예제 #4
0
        internal bool HandlePreviewInput(
            Page page,
            PointerInputEvent pointerInputEvent)
        {
            bool handled = false;

            if (pointerInputEvent.State == PointerInputState.Began)
            {
                LightDismissControl lightDismissControl = this.LightDismissControl;
                if (null != lightDismissControl)
                {
                    // Invoke light dismiss
                    lightDismissControl.OnLightDismiss();

                    this.LightDismissControl = null;

                    handled = true;
                }
            }

            return(handled);
        }
예제 #5
0
 public override bool HandlePointerEvent(
     PointerInputEvent pointerInputEvent)
 {
     return this.Application.HandlePreviewInput(this, pointerInputEvent);
 }
예제 #6
0
 protected abstract void OnPointerInput(
     PointerInputEvent inputEvent,
     ref GestureEventResult result);
예제 #7
0
 internal bool HandlePreviewInput(
     View view,
     PointerInputEvent pointerInputEvent)
 {
     return(this.HandleLightDismissEvent(view, pointerInputEvent));
 }