Example #1
0
        protected override void OnParentDragOver(DragEventArgs e)
        {
            
            _isDragLeave = false;

            var point = e.GetPosition(this);

            if (_startPoint == null || _startPoint.Value.X < 0)
            {
                var date = AxisXConverter.ScreenToData(0);
                var newDate = date.Add(StepMin);
                _stepMinDistance = AxisXConverter.DataToScreen(newDate);

                var pointTime = AxisXConverter.ScreenToData(point.X - point.X % _stepMinDistance).ConvertToMultiplesOfFive();
                System.Diagnostics.Debug.Print(pointTime.ToString());
                var arg = default(DragingRoutedEventArgs);

                var data = e.Data.GetData("Castle.Proxies.TermStyleProxy");

                if (data != null)
                {
                    arg = new DragingRoutedEventArgs(pointTime, data, DraggingEvent, this);
                    RaiseEvent(arg);
                }

                if (arg != null && arg.Target != null)
                {
                    _startPoint = point;
                    _lastPoint = _startPoint;
                }
                else
                {
                    _startPoint = null;
                    _lastPoint = null;
                }

                PointOutBlock = arg == null ? null : arg.Target;
            }

            _canMove = PointOutBlock != null;

            if (_canMove)
            {
                MouseMoving(point);
                InvalidateVisual();
            }
        }
Example #2
0
        protected override void OnParentDragOver(DragEventArgs e)
        {
            _isDragLeave = false;

            var point = e.GetPosition(this);

            if (_startPoint == null || _startPoint.Value.X < 0)
            {
                var date    = AxisXConverter.ScreenToData(0);
                var newDate = date.Add(StepMin);
                _stepMinDistance = AxisXConverter.DataToScreen(newDate);

                var pointTime = AxisXConverter.ScreenToData(point.X - point.X % _stepMinDistance).ConvertToMultiplesOfFive();
                System.Diagnostics.Debug.Print(pointTime.ToString());
                var arg = default(DragingRoutedEventArgs);

                var data = e.Data.GetData("Castle.Proxies.TermStyleProxy");

                if (data != null)
                {
                    arg = new DragingRoutedEventArgs(pointTime, data, DraggingEvent, this);
                    RaiseEvent(arg);
                }

                if (arg != null && arg.Target != null)
                {
                    _startPoint = point;
                    _lastPoint  = _startPoint;
                }
                else
                {
                    _startPoint = null;
                    _lastPoint  = null;
                }

                PointOutBlock = arg == null ? null : arg.Target;
            }

            _canMove = PointOutBlock != null;

            if (_canMove)
            {
                MouseMoving(point);
                InvalidateVisual();
            }
        }