Allow CommandHandler.Copy but not on Ctrl+Drag

My new aim is the following:

I implement copy/paste then allowcopy in diagram, but I don’t want perform a copy on Ctrl+move on a node.

because i use Ctrl key to move only some elements…

Thanks for your precious answers.


That’s right – if you want to allow copying by the user, you have to leave Diagram.AllowCopy true (the default value).

So if you only want to disable Ctrl-dragging resulting in copying, you need to customize the DraggingTool. I haven’t tested this to be sure, but I believe you just need to override a method to return false.

Override MayCopy() if you are not using Windows drag-and-drop in WPF – i.e. Diagram.AllowDragOut is false (the default value).

If you are using Windows drag-and-drop in WPF (because Diagram.AllowDragOut is true), override MayCopyInternal(DragEventArgs) to return false.

I suppose you might as well override both methods to return false.

override MayCopy works.

I searched for CanCopy in this tool, i didn’t see maycopy.