Esempio n. 1
0
 private void RaiseFlick(FlickEventArgs args)
 {
     SafeRaise.Raise<FlickEventArgs>(Flick, this, args);
 }
Esempio n. 2
0
        protected void NotifyUp(InputCompletedArgs args)
        {
            EventArgs e = EventArgs.Empty;
            _dragLock = DragLock.Unset;
            _dragging = false;

            if (args.IsInertial)
            {
                double angle = GestureHelper.AngleFromVector(args.FinalLinearVelocity.X, args.FinalLinearVelocity.Y);
                if (angle <= 45 || angle >= 315)
                {
                    angle = 0;
                }
                else if (angle >= 135 && angle <= 225)
                {
                    angle = 180;
                }

                FlickEventArgs flickEventArgs = new FlickEventArgs
                {
                    Angle = angle
                };
                ReleaseMouseCaptureAtGestureOrigin();
                RaiseFlick(flickEventArgs);
            }
            else if (args.TotalTranslation.X != 0 || args.TotalTranslation.Y != 0)
            {
                DragEventArgs dragEventArgs = new DragEventArgs
                {
                    CumulativeDistance = args.TotalTranslation
                };
                dragEventArgs.MarkAsFinalTouchManipulation();
                e = dragEventArgs;
            }

            RaiseGestureEnd(e);
        }