The simplest way that I've done it is to use a XamlWriter to save the WPF object as a string. The Save method will serialize the object and all of its children in the logical tree. Now you can create a new object and load it with a XamlReader.
ex:
Write the object to xaml (let's say the object was a Grid control):
string gridXaml = XamlWriter.Save(myGrid);
Load it into a new object:
StringReader stringReader = new StringReader(gridXaml);
XmlReader xmlReader = XmlReader.Create(stringReader);
Grid newGrid = (Grid)XamlReader.Load(xmlReader);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…