I am developing an application in windows phone 7 .I want to persist my object which contains private data members so as to restore my application after tomb stoning. Now the problem is
namespace xyz
{
[DataContract]
public class ClassABC
{
[DataMember]
private string a;
[DataMember]
private A b ; // A is a user defined class which is also serializable
}
}
now when I use
ClassABC abc = new ClassABC();
var axds= IsolatedStorage.ApplicationSettings;
axdes["some key"] = abc ;
IsolatedStorage.ApplicationSettings.save();
// this raised a security exception that ClassABC is not serializable because it is not public.
I don't know why is this problem occurring.
Please help.