I am trying to find out the events fired by xamDiagram when an item from toolbox is being dragged and moved around within diagram.
Take a look at this attached screenshot of one of the samples included in controls, I am trying to drag (& drop) rectangle onto diagram, how can I detect an item being dragged on it?
Hello Abs,
There is no specific event triggered when an item from the toolbox is being dragged and moved within the xamDiagram control. The events for the toolbox item dragging from the toolbox are handled internally and there are no publicly exposed events.
Several events are triggered when the item is already dropped within the xamDiagram surface. These are the XamDiagram ItemAdding, ItemAdded, NodeMoving and NodeMoved events.
If this is an option for you, you can handle the PreviewMouseDown and PreviewMouseUp events to handle when a toolbox item is clicked and when the mouse button is released for the DiagramToolboxCategoryItem.
I’ve attached a sample project demonstrating this.
We need to take some actions when an item is being dragged on the diagram, but not dropped yet. We programmatically add the new item to the model and the connections are also added automatically.
What we want to do is to highlight the potential existing items the dragged item can be connected with. This is why we need to know when something is being dragged (as well as its current location).
We understand you do not expose these events right now but do you plan to do this in a future version? Also, the diagram exposes the MouseMove event, inherited from WPF. This is being fired but oddly, not when an item is dragged from the diagram. That is, we can intercept this event if the mouse is moved across the diagram, but not when the mouse drags an item across the diagram. Is this the intended behavior?