protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) { base.OnMouseLeftButtonDown(e); Point position = e.MouseDevice.GetPosition((IInputElement)this); if (this.controlPoint1Editor.HitTest(position.X, position.Y)) { this.activePointEditor = this.controlPoint1Editor; } if (this.controlPoint2Editor.HitTest(position.X, position.Y)) { this.activePointEditor = this.controlPoint2Editor; } if (this.activePointEditor == null) { return; } if (!this.CaptureMouse()) { this.activePointEditor = (ControlPointEditor)null; } else { ValueEditorUtils.ExecuteCommand(this.BeginEditCommand, (IInputElement)this, null); } }
protected override void OnLostMouseCapture(MouseEventArgs e) { base.OnLostMouseCapture(e); this.activePointEditor = (ControlPointEditor)null; ValueEditorUtils.ExecuteCommand(this.CommitEditCommand, (IInputElement)this, null); }