0

I want to store custom objects in isolatedstoragesettings of WP7.1 application. My program works well if I hard-code it. But without hard-coding it gives exception on Save() method of isolatedstoragesettings class.

Exception is:

Type 'PhoneApp4.Classes.Objects.Person' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute.

Please Provide some sample code or suggestion to begin, because I am new to windows phone.

Wouter J
  • 41,455
  • 15
  • 107
  • 112
djain
  • 13
  • 2
  • 7

1 Answers1

1

Yes, you should make it serializable. Check out this article: http://www.codeproject.com/Articles/268151/XML-Serialization-in-Windows-Phone-7-Tips-and-Tric

Jocke
  • 2,189
  • 1
  • 16
  • 24
  • Thank you for your answer.Please can you also give me link for JSON Serializer. – djain Feb 04 '13 at 07:54
  • I would recommend http://json.codeplex.com/ Here is a related post on OS http://stackoverflow.com/questions/6561646/json-serialization-for-windows-phone-7 – Jocke Feb 04 '13 at 08:01