private void UpdateDropTarget(MouseEventArgs e) { if (!_isCorrectParents) { CursorManager.SetGlobalCursor(CustomCursors.Ban); return; } IDropTarget dropTarget = GetCorrectDropTarget(e); if (dropTarget == null) { CursorManager.SetGlobalCursor(CustomCursors.Ban); if (_currentDropTarget != null) { _currentDropTarget.OnLeaveDropZone(); _currentDropTarget = null; } } else { if (!CanDrop(dropTarget, e)) { CursorManager.SetGlobalCursor(CustomCursors.Ban); if (_currentDropTarget != null) { _currentDropTarget.OnLeaveDropZone(); _currentDropTarget = null; } return; } CursorManager.ClearGlobalCursor(); if (_currentDropTarget == dropTarget) { if (IsMultipleDrag) { dropTarget.OnMoveInDropZone(_currentDragSources, e); } else { dropTarget.OnMoveInDropZone(_mainDragSource, e); } } else { if (_currentDropTarget != null) { _currentDropTarget.OnLeaveDropZone(); } if (IsMultipleDrag) { dropTarget.OnEnterDropZone(_currentDragSources, e); } else { dropTarget.OnEnterDropZone(_mainDragSource, e); } } } _currentDropTarget = dropTarget; }
private void ClearDrag() { _mainDragSource = null; _currentDragSources.Clear(); if (HasCurrentDisplayDragSources) { foreach (var item in _currentDisplayDragSources) { _rootDropArea.Children.Remove(item); } _currentDisplayDragSources.Clear(); } CursorManager.ClearGlobalCursor(); }