我有一个问题,我有一个列表类型ObservableCollection<>。我想将此列表保存到隔离存储中的文件JSON数据对象 怎么用?
答案 0 :(得分:2)
或者您可以保存ObservableCollection<>直接到IsolatedStorage:
ObservableCollection<Person> obsPerson = new ObservableCollection<Person>();
//Storage
IsolatedStorageSettings.ApplicationSettings["obsPerson"] = obsPerson;
//Retrieval
if (IsolatedStorageSettings.ApplicationSettings.Contains("obsPerson"))
{
ObservableCollection<Person> obsPerson = (ObservableCollection<person>)IsolatedStorageSettings.ApplicationSettings["obsPerson"];
}