Simulate DND

Is there a way to simulate drag and drop for a diagram (in something similar to the logic circuit demo)

In general, no. We have not yet implemented support for automation.

Within a diagram, though, you could do something like:

myDiagram.FirstMousePointInModel = new Point(50, 50); myDiagram.LastMousePointInModel = new Point(50, 50); myDiagram.CurrentTool.DoMouseDown(); myDiagram.LastMousePointInModel = new Point(55, 55); myDiagram.CurrentTool.DoMouseMove(); myDiagram.LastMousePointInModel = new Point(155, 255); myDiagram.CurrentTool.DoMouseMove(); myDiagram.LastMousePointInModel = new Point(255, 255); myDiagram.CurrentTool.DoMouseUp();

Can this be done for a drag and drop from a palette to a diagram as well?

Not by calling the IDiagramTool methods, as shown above.

You would need to create MouseButtonEventArgs and either call the OnMouse[Left/Right]Button[Down/Move/Up] methods in a subclass of DiagramPanel, or raise the mouse events by calling the event handlers on the DiagramPanel.

You didn’t say if you were interested in WPF or in Silverlight. It isn’t clear to me that you can create a useful MouseButtonEventArgs in Silverlight.