I am trying to save a list of a custom class to isolatedstoragesettings, but either it is not saving correctly or not retrieving correctly and I am not sure whats wrong,
class:
[DataContract()]
public class Object
{
public int ID { get; set; }
public bool IsDeleted { get; set; }
public bool IsActive { get; set; }
public string Title { get; set; }
public string Author { get; set; }
public string Synopsis { get; set; }
public string Body { get; set; }
public string ImageUrl { get; set; }
public string CreationDate { get; set; }
public string LastUpdateDate { get; set; }
public string DisplayUntilDate { get; set; }
public int TotalViews { get; set; }
public Gallery Gallery { get; set; }
}
then I am using this to save it
List<Object> to_save = new List<Object>();
//populate the list of objects, this works correctly, it just makes a big list of objects then
var settings = IsolatedStorageSettings.ApplicationSettings;
//save to_save to isolated storage
settings.Add("Stories", to_save);
settings.Save();
then when I try and retrieve it:
//get the details from the isolated storage
var settings = IsolatedStorageSettings.ApplicationSettings;
List<Object> s = settings["Stories"] as List<Object>;
it just give me 2 items that is both null, I think I am doing the serialization wrong, but I don't know the correct way, could someone please help?
Edit:
Ok I have added datamember to each field, now the 2 items returned is not null and contains the correct values, however it is not the entire list, how can I retrieve the entire list, istead of just 2 items?