我有一个ListBox
填充来自XML的数据。 到目前为止,问题在于当我尝试将其删除时出现一些错误。不能墓碑ItemsBox的列表框
protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e)
{
State["listbox1"] = listBox1.ItemsSource;
}
然后:
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
if (State.ContainsKey("listbox1"))
{
listBox1.ItemsSource = (IEnumerable)State["listbox1"];
}
}
当我打的启动按钮,我已经得到一个错误。该App.xaml.cs
打开和线下变成黄色
System.Diagnostics.Debugger.Break();
我也用墓碑助手,但它并没有在我的列表框返回的项目。
什么类型的项目?它是可序列化的吗? –
BRB,让我的魔法异常8球。 – Will