/// <summary> /// Raises the <see cref="UIElement.MouseDown"/> event. /// </summary> /// <param name="e"> /// The <see cref="MouseButtonEventArgs"/> instance containing the event data. /// </param> protected override void OnMouseDown(MouseButtonEventArgs e) { if (e == null) { throw new ArgumentNullException(nameof(e)); } base.OnMouseDown(e); if (e.Handled || _header == null || !_header.IsMouseOver) { return; } if (e.ChangedButton == MouseButton.Left || (e.ChangedButton == MouseButton.Right && !IsSelected)) { e.Handled = true; ParentTreeView?.MoveSelection(this); } }