How to remove all shapes from Diagram

Mar 13, 2013 at 7: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++)
Mar 14, 2013 at 1:16 AM

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,