public override void MouseLeftButtonDown(Point position) { if (Chart.XAxis.ActualRange == null || Chart.YAxis.ActualRange == null || !BehaviourContainer.CaptureMouse()) { return; } _leftMouseDown = true; _firstPosition = position; //Set the up the zoom rectangle _selectionRectangle.SetValue(Canvas.LeftProperty, position.X); _selectionRectangle.SetValue(Canvas.TopProperty, UseFullYAxis ? 0 : position.Y); _selectionRectangle.Width = 0; _selectionRectangle.Height = UseFullYAxis ? BehaviourContainer.ActualHeight : 0; if (_selectionRectangle.Border != null) { _selectionRectangle.Border.Background = new SolidColorBrush(new Color { A = 60, R = 255, B = 0, G = 0 }); _selectionRectangle.Border.BorderBrush = new SolidColorBrush(new Color { A = 255, R = 255, B = 0, G = 0 }); } //Make it visible _selectionRectangle.Visibility = Visibility.Visible; }
public override void MouseLeftButtonDown(Point position) { if (Chart.XAxis.ActualRange == null || Chart.YAxis.ActualRange == null || !BehaviourContainer.CaptureMouse() || Keyboard.Modifiers == ModifierKeys.Shift) { return; } _leftMouseDown = true; _firstPosition = position; //Set the up the zoom rectangle _zoomRectangle.SetValue(Canvas.LeftProperty, position.X); _zoomRectangle.SetValue(Canvas.TopProperty, position.Y); _zoomRectangle.Width = 0; _zoomRectangle.Height = 0; if (_zoomRectangle.Border != null) { _zoomRectangle.Border.Background = _zoomRectangle.Background; _zoomRectangle.Border.BorderBrush = _zoomRectangle.Foreground; } //Make it visible _zoomRectangle.Visibility = Visibility.Visible; }