コード例 #1
0
        /// <summary>
        /// Override of <see cref="BehaviourBase"/> that handles the mouse being dragged
        /// and changing the Y-value of the clicked point
        /// </summary>
        /// <param name="position">Position that the mouse moved to.</param>
        public override void MouseMove(Point position)
        {
            if (!_leftMouseDown || _selectedPoint == null || (int)Chart.Tag > 1)
            {
                var p     = ((Chart.Behaviour as BehaviourManager).Behaviours[2] as TrackballBehaviour).CurrentPoints[1];
                var args0 = new PointSelectedEventArgs {
                    Point = new Core.Model.Point((double)p.X, (double)p.Y), Selected = false
                };
                OnPointSelected(this, args0);
                return;
            }

            var x = Chart.XAxis.GetRenderPositionAsDataValueWithZoom(position.X);
            var y = Chart.YAxis.GetRenderPositionAsDataValueWithZoom(position.Y);

            var args = new PointMoveEventArgs {
                OldPoint = new Core.Model.Point((double)_selectedPoint.X, (double)_selectedPoint.Y), NewPoint = new Core.Model.Point((double)x, (double)y)
            };

            if (OnPointMove != null)
            {
                OnPointMove(this, args);

                _selectedPoint.XValue = args.NewPoint.X;
                _selectedPoint.YValue = args.NewPoint.Y;
            }
        }
        /// <summary>
        /// Override of <see cref="BehaviourBase"/> that handles the mouse being dragged
        /// and changing the Y-value of the clicked point
        /// </summary>
        /// <param name="position">Position that the mouse moved to.</param>
        public override void MouseMove(Point position)
        {
            if (!_leftMouseDown || _selectedPoint == null)
            {
                return;
            }

            var x = Chart.XAxis.GetRenderPositionAsDataValueWithZoom(position.X);
            var y = Chart.YAxis.GetRenderPositionAsDataValueWithZoom(position.Y);

            var args = new PointMoveEventArgs {
                OldPoint = new Core.Model.Point((double)_selectedPoint.X, (double)_selectedPoint.Y), NewPoint = new Core.Model.Point((double)x, (double)y)
            };

            if (OnPointMove != null)
            {
                OnPointMove(this, args);

                _selectedPoint.XValue = args.NewPoint.X;
                _selectedPoint.YValue = args.NewPoint.Y;
            }
        }
コード例 #3
0
        /// <summary>
        /// Override of <see cref="BehaviourBase"/> that handles the mouse being dragged
        /// and changing the Y-value of the clicked point
        /// </summary>
        /// <param name="position">Position that the mouse moved to.</param>
        public override void MouseMove(Point position)
        {
            if (!_leftMouseDown || _selectedPoint == null)
            {
                return;
            }

            var x = Chart.XAxis.GetRenderPositionAsDataValueWithZoom(position.X);
            var y = Chart.YAxis.GetRenderPositionAsDataValueWithZoom(position.Y);

            var args = new PointMoveEventArgs { OldPoint = new Core.Model.Point((double)_selectedPoint.X, (double)_selectedPoint.Y), NewPoint = new Core.Model.Point((double)x, (double)y) };
            if (OnPointMove != null)
            {
                OnPointMove(this, args);

                _selectedPoint.XValue = args.NewPoint.X;
                _selectedPoint.YValue = args.NewPoint.Y;
            }

        }