Example #1
0
        /// <summary>
        /// 移動中動作
        /// </summary>
        /// <param name="e"></param>
        private void OnMove(PointerTapEventArgs e, UIElement target)
        {
            var point = (Vector)e.GetPosition(this.AssociatedObject);


            if ((point - this.startPosition).LengthSquared > 800)
            {
                this.moved = true;
            }
        }
        /// <summary>
        /// 移動中動作
        /// </summary>
        /// <param name="e"></param>
        private void OnMove(PointerTapEventArgs e, UIElement target)
        {
            //this.isInartiaMoving = false;

            if (!this.isMouseCapturing)
            {
                return;
            }

            var point = (Vector)e.GetPosition(this.AssociatedObject);

            this.positionHistory.Push(point);

            this.CurrentOffset = (Point)(this.startOffset - point + this.startPosition);
        }
Example #3
0
        /// <summary>
        /// アップ時動作
        /// </summary>
        /// <param name="e"></param>
        private void OnUp(PointerTapEventArgs e, UIElement target)
        {
            var timeSpan = DateTime.Now - this.startTime;

            if (!this.moved)
            {
                var args = e.Clone();

                args.Span          = timeSpan;
                args.StartPosition = this.startPosition;
                args.EndPosition   = (Vector)e.GetPosition(this.AssociatedObject);
                args.SenderHeight  = this.AssociatedObject.ActualHeight;
                args.SenderWidth   = this.AssociatedObject.ActualWidth;

                this.TapSubject.OnNext(args);
            }
        }