Clearing and Recreating a Diagram

I am creating a simple diagram with nodes and connections. The diagram control is added in XAML. In a handler I clear the connecions and Nodes through this method:

diagramModel.Nodes.Clear();
diagramModel.Connections.Clear();

When I try to recreate the diagram using the same code all of the nodes get added to the top left of the diagram and overlap each other. I am using the HeierarchialTree layout. Do I need to do something else to clear the diagram?


2 Replies

PS Phil Sullivan March 4, 2011 04:04 PM UTC

This is regarding the WPF diagram, my apologies that I submitted it in ASP.NET forum.



PS Phil Sullivan March 4, 2011 04:59 PM UTC

Stumbled accross the solution:

HierarchicalTreeLayout tree = new HierarchicalTreeLayout(diagramModel, diagramView);

tree.RefreshLayout();


Loader.
Up arrow icon