Hi does anybody know how to clone a chart object (deep copy)..
I tried this method using XamlReader and XamlWriter,
public Chart DeepCopy(Chart element)
string shapestring = XamlWriter.Save(element);
StringReader stringReader = new StringReader(shapestring);
XmlTextReader xmlTextReader = new XmlTextReader(stringReader);
Chart DeepCopyobject = (Chart)XamlReader.Load(xmlTextReader);
But it is running in to "Stack Overflow Exception" at this first line of function - string shapestring = XamlWriter.Save(element); (seems like the get/set functions of axes and series properties are called recursively)..
Is there any other way to deep copy the WPF toolkit's chart object?