예제 #1
0
        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);
        }
예제 #2
0
 public static void SetTheDropOperation(DependencyObject obj, IDropOperation value)
 {
     obj.SetValue(TheDropOperationProperty, value);
 }