protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e) { base.OnMouseLeftButtonUp(e); var mousePosition = e.GetPosition(this); if (_multiSelection) { CompleteRectangleSelection(mousePosition); _multiSelectedElements.ForEach(el => AddSelectedElement(el, true)); _multiSelectedElements.Clear(); _multiSelection = false; } else { if (_graphViewModel.SelectedElementsCount > 0 & _changePosition) { _changePosition = false; _graphViewModel.ChangePosition(mousePosition); } } _targetUiElement = null; ReleaseMouseCapture(); }