Пример #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));
 }