private static void OnMouseUp(object sender, FrameworkElement attachedToEl) { FrameworkElement draggedEl = (FrameworkElement)sender; bool canDrop = SetMousePosition(draggedEl, attachedToEl); if (canDrop) { FrameworkElement containerEl = GetContainerElement(attachedToEl); // drop IDropOperation dropOperation = GetTheDropOperation(attachedToEl); Point mousePositionWithinContainerElement = GetMousePositionWithinContainerElement(attachedToEl); dropOperation.Drop(draggedEl, containerEl, mousePositionWithinContainerElement); SetCanDrop(attachedToEl, false); } SetIsDragAbove(attachedToEl, false); }
public static void SetTheDropOperation(DependencyObject obj, IDropOperation value) { obj.SetValue(TheDropOperationProperty, value); }