I know two ways you can try:
Save the object in the xaml line and recreate it. ( XamlWriter.Save and XamlReader.Parse )
Save the object using the serializer in memystream and recreate it from this - it is possible that not all objects are marked as serializable, so another option may be the one that will be used.
This may seem a bit - but there are not many ways to create a deep copy, and not some standard C # method that I know of.
source share