Beispiel #1
0
 private void DropTargetContainer_MouseLeave(object sender, MouseEventArgs e)
 {
     if (!DragManager.IsDragging)
     {
         return;
     }
     DragManager.UpdateDropTarget(null);
 }
Beispiel #2
0
 private void Designer_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     if (!e.Handled)
     {
         DragManager.Drop();
         e.Handled = true;
     }
 }
Beispiel #3
0
        private void DropTargetContainer_MouseMove(object sender, MouseEventArgs e)
        {
            if (!DragManager.IsDragging || e.OriginalSource != sender)
            {
                return;
            }
            var dropTarget = this.dropTarget.GetDropLocation(e.GetPosition(DropTargetContainer));

            DragManager.UpdateDropTarget(dropTarget);
        }
        private void DragSourceContainer_MouseLeave(object sender, MouseEventArgs e)
        {
            var coordinates = Coordinates(e);

            if (DragManager.DragCandidate != null &&
                DragManager.DragCandidateSponsor == DragSource &&
                !DragManager.IsDragging)
            {
                SelectionManager.ClearSelection();
                DragSource.StartDrag(DragManager.DragCandidate);
                DragManager.MouseMove(e.GetPosition(Designer.Instance.Canvas));
            }
        }
Beispiel #5
0
        public override void StartDrag(UIElement underCursor)
        {
            ToolboxItem item = underCursor as ToolboxItem;

            if (item == null)
            {
                return;
            }
            var copy = Factory.CreateControl(item.Title);

            DragManager.StartDrag(this, underCursor);
            DragManager.DraggedElement = copy;
        }
        private void DragSourceContainer_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            // this entire handler only makes sense if we have a drag candidate
            if (DragManager.DragCandidate == null || DragManager.DragCandidateSponsor == null)
            {
                return;
            }

            var coordinates = Coordinates(e);

            if (DragSource is ISupportSelection &&
                (DragSource as ISupportSelection).IsSelectionAllowed(DragManager.DragCandidate) &&
                coordinates.Distance(mouseDownCoordinates) < 15 &&
                !DragManager.IsDragging)
            {
                DragManager.DragCandidateSponsor.Select(DragManager.DragCandidate);
            }

            DragManager.ResetDragCandidate();
        }
 public virtual void StartDrag(UIElement result)
 {
     DragManager.StartDrag(this, result);
 }
Beispiel #8
0
 private void DropTargetContainer_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     DragManager.Drop();
     e.Handled = true;
 }
Beispiel #9
0
 private void Designer_MouseMove(object sender, MouseEventArgs e)
 {
     DragManager.MouseMove(e.GetPosition(this));
 }