我是 Windows Phone 8 开发的新手。
我在主页中有一个 ListBox,单击列表项后,根据所选项目的 id,我需要传递 id 并导航到下一页,
这是我的代码,
public void ServerList_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
var current = ServerList.SelectedItem as readqueriesObject;
NavigationService.Navigate(new Uri("/singlequery.xaml?selectedItem=" +current.Query_Id , UriKind.Relative));
// Reset selected index to -1 (no selection)
ServerList.SelectedIndex = -1;
}
public class readqueriesObject
{
public string Query_Id { get; set; }
public string Query_Status { get; set; }
public int count { get; set; }
public List<object> historyList { get; set; }
public string Query_Type { get; set; }
}
这是我得到的例外,
“PhoneApp1.DLL 中发生了‘System.NullReferenceException’类型的异常,但未在用户代码中处理”