public class MyDoc
{
public string Private {set;get;}
public string Public {set;get;}
}
public class MyFind
{
public string Find {set;get;}
public string News {set;get;}
private ObservableCollection<MyDoc> _smalllist;
public ObservableCollection<MyDoc> SmallList
{
get
{
if (_smalllist == null)
{
_smalllist = new ObservableCollection<MyDoc>();
}
return _smalllist;
}
set
{
if (_smalllist != value)
{
_smalllist = value;
}
}
}
}
public class Ask
{
private ObservableCollection<MyFind> _Biglist;
public ObservableCollection<MyFind> BigList
{
get
{
if (_Biglist == null)
{
_Biglist = new ObservableCollection<MyFind>();
}
return _Biglist;
}
set
{
if (_Biglist != value)
{
__Biglist = value;
}
}
}
}
如何保存IsolatedStorage小名单和大名单?
(“重要:进入BigList需要2个字符串和1个ObservableCollection&lt;&gt;”)。
我们可以在课堂上看到MyFind有一个ObservableCollection和2个字符串在MyAsk中有一个ObservableCollection
答案 0 :(得分:1)
您需要创建自己的可序列化可观察集合:检查此http://kentb.blogspot.com/2007/11/serializing-observablecollection.html
另一种选择是创建一个IList支持字段并创建一个标记为Non-Serializable的包装ObservableCollection属性