Hi we are trying to prevent drawing connectors on the diagram and instead require our custom connector to be drawn. We are cancelling the ItemAdding event on the diagram and this is preventing the connector from appearing on the canvas, however a diagramConnection is still attached to the outgoingConnections of the Node on which the drawing occurred.
Q1. Is this intended behaviour? i would have expected the cancelling of the add to do both
I've noticed that if we set ConnectionPointsDisplayMode="Never" then you dont get the pointer, unless you have custom connection points defined on the shapes.
Q2. Is there a way of disabling the drawing or do we need to remove this ourselves manually?
Regards
Nick
Hello Nick,
May I have a small sample application that demonstrates the behavior you are seeing?
Thank you,
Mihoko Kamiishi
Ive realised i was loading persisted diagrams that have ConnectionPointsDisplayMode set to MouseOver . If i create new diagrams with this set to Auto i can then not draw on the connectors, but i then can't see where to drag a connector to.
So only the problem with the canceling still adding to the collection remains
Thank you for your feedback Mihoko
On your sample i cannot draw the connectors unless i change ConnectionPointsDisplayMode to MouseOver - so im still looking at my code as to why i always see the connectors in our code.
When i do make that change, if i break on the end of the ItemAdding routine , and create a watch on
sender.Items[x].OutgoingConnections
where x is the index of the shape in the diagram items collection onto which i drew.
I can see this collection growing. The cancel doesnt stop the connection being added to this collection
I have been trying to reproduce the problem you described but not successful.
I have created a sample of XamDiagram along with XamDiagramToolbox, and canceled XamDiagram's ItemAdding event.Can you please run this project on your PC, and let me know if your problem is reproducible with this?
Thank you,Mihoko Kamiishi
by the way - we are using a service release of 16.1