Serialization of ModelBase objects

Aug 12, 2014 at 5:11 PM
Edited Aug 12, 2014 at 5:26 PM
I have a requirement to store data locally in an XML file which we do via Serialization of the data model. I have a model that extends ModelBase that works until I add the [Serialization] attribute.

As a test, I created a new WPF project and added the [Serializable] attribute to the Customer object in Customer.cs and the Clone process fails at line 27 in ModelExtensions.cs
ser.WriteObject(stream, obj);
Do you know if there is a way to implement Serialization on a class extending ModelBase? We are using .NET 4.0 System.Xml.Serialization if that matters.
Aug 12, 2014 at 5:52 PM
Please ignore this, I forgot to add the default constructor to one of the classes as mentioned in this post https://simplemvvmtoolkit.codeplex.com/discussions/451050

Once I did that there was no need for the [Serialization] tag.