Exemplo n.º 1
0
        private void ContentControlManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
        {
            if (e.PointerDeviceType != PointerDeviceType.Touch)
            {
                return;
            }

            var diffY = Math.Abs(e.Position.Y - manipulationStartPosition.Y);

            if (diffY > 100)
            {
                return;
            }

            var diffX = e.Position.X - manipulationStartPosition.X;

            if (diffX > 100)
            {
                SwipeLeftCommand?.Execute(null);
            }
            else if (diffX < 100)
            {
                SwipeRightCommand?.Execute(null);
            }
        }
Exemplo n.º 2
0
        void IMycoSwipeGestureRecognizerController.SendSwipeRight(MycoView view)
        {
            if (SwipeRightCommand != null)
            {
                SwipeRightCommand.Execute(SwipeRightCommandParameter);
            }

            if (SwipeRight != null)
            {
                SwipeRight(view, new EventArgs());
            }
        }
Exemplo n.º 3
0
        public void OnSwipeRight()
        {
            if (SwipeRightCommand != null && SwipeRightCommand.CanExecute(null))
            {
                SwipeRightCommand.Execute(null);
            }

            EventHandler handler = SwipeRight;

            if (handler != null)
            {
                handler(this, new EventArgs());
            }
        }
Exemplo n.º 4
0
        public void SwipeRightEvent()
        {
            var para = SwipeRightCommandParameter ?? CommandParameter;

            if (null != SwipeRightCommand)
            {
                if (SwipeRightCommand.CanExecute(para))
                {
                    SwipeRightCommand.Execute(para);
                }
            }
            else
            {
                SwipeRight?.Invoke(this, para);
            }
        }