Removing Edges in a CompoundGraph

Jun 15, 2010 at 12:29 AM
Hi, I started using Graph# in my product, and really enjoy it so far. Maybe it's because I'm new but I'm hoping someone can shed some light on an issue I'm having. When I call the RemoveEdge method on my CompoundGraph instance, the GraphLayout control is not updating the graph's layout. After digging through the GraphLayout source, it looks like it checks the value of a protected property called IsCompoundMode. If that property is set to true then the GraphLayout does not subscribe to the graph's EdgeAdded and EdgeRemoved events. How easy would it be to modify the code so that my CompoundGraph can have its layout updated whenever I programmatically remove an edge? Thanks, Jerry
Jun 30, 2010 at 3:01 PM
Edited Jun 30, 2010 at 3:02 PM
I'm experiencing the same problem. I've implemented drag-n-drop support for vertices and edge-creation through CTRL+drag and I want to reflect my changes directly and without relayouting (just update the UI)! Replacing all occurances of IsCompoundMode in GraphSharp.Controls.GraphLayout.RecreateGraphElements with false makes the UI relect my changes and behaves nicely. So, is there any particular reason why I shouldn't solve it this way? (apart from having to hack your source since RecreateGraphElements isn't virtual). Kind regards, Richard