Hi,
If you need a predefined set of additional properties, you could add them to your custom ShapeNode -derived class and implement serialization like this:
protected override void SaveToXml(System.Xml.Linq.XElement xmlElement, XmlPersistContext context)
{
base.SaveToXml(xmlElement, context);
context.WriteString(Title, "Title", xmlElement);
context.WriteString(FullName, "FullName", xmlElement);
}
protected override void LoadFromXml(System.Xml.Linq.XElement xmlElement, XmlPersistContext context)
{
base.LoadFromXml(xmlElement, context);
Title = context.ReadString("Title", xmlElement);
FullName = context.ReadString("FullName", xmlElement);
}
You should also call the RegisterItemClass method to define the xml element name for your nodes.
If you need to let users set arbitrary properties as in Visio, you could implement that by storing them in Dictionary<string,Object> or Dictionary<string,string>, either by adding the dictionary as a property of a custom class or by storing it as a value of the node.Tag property.
I hope that helps,
Stoyan