0

I am trying to develop xaml app for Windows Store. During development I faced a problem. I want to save a generic list of object to the local store but each time I try to save the list, it fires an exception of "type not supported".

Can anybody help me out on saving and restoring generic list in the localstore in windows 8 app.

master.fake
  • 487
  • 1
  • 6
  • 22

2 Answers2

1

Take a look on this article Accessing app data with the Windows Runtime (Windows Store apps), you cannot store in App Settings anything except Windows Runtime base types. I tried to approaches for myself: a) use serialization with JSON.net, serialize data to file on suspending and restore it on startup. b) use sqlite and sqlite-net to just use simple db in my app.

outcoldman
  • 11,584
  • 2
  • 26
  • 30
1

Thank you everyone for the suggestion.

I got the solution by first serializing data to jsonstring and saving the serialized data as string in the storage and restoring the data using deserialization..

master.fake
  • 487
  • 1
  • 6
  • 22
  • +1 This is awesome idea. I like it. I didn't apply yet, but this must be implemented perfectly because saving string in storage is an easy process, and serializing data into json means converting the whole data into string format and then by deserialize it will convert back. This is pretty awesome. Thanks. – Zia Ur Rahman Jan 05 '16 at 11:23