I created a proj based on your class diagram example. I wanted to extend this example to save and reload the layout from disk. I called the diagram Save method and this is the Xml returned (I have removed some attributes for clarity). My question is when I call diagram Load, how do I re-attach the Model objects to the shapes in the diagrams? From the Xml below I can see a Shapes content contains the class name of the Model (MyProj.ClassViewModel) that represents that shape. Do I have to iterate all of the Shapes and set their content? If so how can I get this xml to store a key for the instance of the model a shape it contains.
Thanks Craig.
<?xml version="1.0" encoding="utf-8"?>
<RadDiagram Type="Telerik.Windows.Diagrams.Core.IGraphInternal" Version="2012.1">
<Metadata Id="601d134b-3a2c-4055-9f7f-78d70597b052" >
<Title><![CDATA[Diagram [4/12/2012 8:44:45 AM]]]></Title>
<Description><![CDATA[]]></Description>
<Background>#00FFFFFF</Background>
</Metadata> <Shapes QNs="Telerik.Windows.Controls.Diagrams, Version=2012.1.326.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7;"> <RadDiagramShape Type="Telerik.Windows.Controls.RadDiagramShape" Id="4b632971-9f11-41a8-88b4-67992258e376" Content="MyProj.ClassViewModel" Geometry="M0,0L60,0 60,40 0,40z" QN="0" /> </Shapes>
<Connections />
</RadDiagram>