예제 #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
        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);
        }
예제 #3
0
 protected abstract void OnPointerInput(
     PointerInputEvent inputEvent,
     ref GestureEventResult result);