private void OnDragServiceDrop(object sender, DragServiceEventArgs e) { if (IsMouseInside) { var elementBase = e.Data.GetData("DESIGNER_ITEM") as ElementBase; if (elementBase != null) { Toolbox.SetDefault(); //elementBase.SetDefault(); Point position = Mouse.GetPosition(this); elementBase.Position = position; CreateDesignerItem(elementBase); e.Handled = true; } _startPoint = null; } }
private void OnDragServiceDragOver(object sender, DragServiceEventArgs e) { if (IsMouseInside) { e.Effects = e.Data.GetDataPresent("DESIGNER_ITEM") ? DragDropEffects.Move : DragDropEffects.None; if (e.Effects == DragDropEffects.Move) { Toolbox.SetDefault(); DeselectAll(); e.Handled = true; } } }
private void DragScope_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e) { if (IsDragging && Drop != null) { var ee = new DragServiceEventArgs(_dataObject); Drop(this, ee); if (ee.Handled) { Mouse.OverrideCursor = null ; StopDragSimulate(false); e.Handled = true; } } }
private void DragScope_MouseMove(object sender, MouseEventArgs e) { if (IsDragging) { if (_dragAdorner != null) _dragAdorner.UpdatePosition(e.GetPosition(_dragScope)); Mouse.OverrideCursor = Cursors.No; if (DragOver != null) { var ee = new DragServiceEventArgs(_dataObject); DragOver(this, ee); if (ee.Handled) { Mouse.OverrideCursor = ee.Effects == DragDropEffects.Move ? null : Cursors.No; e.Handled = true; } } if (!_useDefaultCursor && !e.Handled) e.Handled = true; } }
private void OnDragServiceDrop(object sender, DragServiceEventArgs e) { if (IsMouseInside()) { var elementBase = e.Data.GetData("DESIGNER_ITEM") as ElementBase; if (elementBase != null) { Toolbox.SetDefault(); //elementBase.SetDefault(); Point position = Mouse.GetPosition(this); elementBase.SetPosition(position); if (GridLineController != null) elementBase.SetPosition(elementBase.GetPosition() + GridLineController.Pull(elementBase.GetRectangle())); CreateDesignerItem(elementBase); e.Handled = true; } _startPoint = null; } }