I have a system.document.table object and i want to mark that object as Serializable for deep cloning it. the exception is Type 'System.Windows.Documents.Table' in Assembly 'PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is not marked as serializable.
FlowTable original = new FlowTable();
original = objFlowTab.deepclone();
where objflowtab is having a table object
[Serializable]
public class FlowTable : Table
{ ....
....
public static class ExtensionMethods
{
// Deep clone
public static T DeepClone<T>(this T a)
{
using (MemoryStream stream = new MemoryStream())
{
BinaryFormatter formatter = new BinaryFormatter();
formatter.Serialize(stream,a);
stream.Position = 0;
return (T)formatter.Deserialize(stream);
}
}
}
i am getting error in formatter.Serialize(stream,a);