How to remove all shapes from Diagram

Mar 13, 2013 at 8:53 PM
I have added few shapes, now after some process I want to remove all shapes and want to add more shapes.

right now below functionality clear whole screen and not rendering anything.
            IShape[] currentShapes = dependencyDiagram.Shapes.ToArray<IShape>();

            for (int i = 0; i < currentShapes.Count(); i++)
                dependencyDiagram.RemoveShape(currentShapes[i]);
Thanks
Rushi
Coordinator
Mar 14, 2013 at 2:16 AM
Rushi,

You only need to remove the shapes from the diagram.Shapes collection. If you set an ObservableCollection<IShape> there, you only have to update this collection by adding or removing shapes, and binding will do its magic. You could even use the Clear() method.

Hope this helps,
-Pablo