/// <summary> /// Override to provide the right mouse action when trying /// to create links on the diagram /// </summary> /// <param name="pointArgs"></param> public override void OnViewMouseEnter(DiagramPointEventArgs pointArgs) { if (pointArgs == null) { throw new ArgumentNullException("pointArgs"); } MouseAction action = null; if (ActiveDiagramView != null) { if (ActiveDiagramView.SelectedToolboxItemSupportsFilterString(EditorFactory.RelationshipFeatureConnectorFilterString)) { action = this.RelationshipFeatureConnectorConnectAction; } if (ActiveDiagramView.SelectedToolboxItemSupportsFilterString(EditorFactory.RelationshipFeatureSetConnectorFilterString)) { action = this.RelationshipFeatureSetConnectorConnectAction; } } if (pointArgs.DiagramClientView.ActiveMouseAction != action) { pointArgs.DiagramClientView.ActiveMouseAction = action; } }
public override void Execute(object parameter) { ActiveDiagramView.State = ECanvasState.DraggingElement; ActiveDiagramView.Cursor = Cursors.Hand; dragData = PrepareButtonData(); dragData.DragCompleted += dragData_DragCompleted; ActiveDiagramView.Children.Add(dragData.DraggedObject); DragButtonData classButtonData = dragData; classButtonData.AssociateWithControl(Control); ActiveDiagramView.draggingElementState.DragData = classButtonData; classButtonData.DraggedObject.Visibility = Visibility.Hidden; classButtonData.Sender = Control; ActiveDiagramView.CaptureMouse(); }