private void PersonalInfoList_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
System.Collections.IList list = e.AddedItems;
if (e.AddedItems.Count == 1)
{
IEnumerable<Category> categs = list.Cast<Category>();
Category em = categs.ElementAt<Category>(0);
int id = em.id;
int categoryid = em.categoryid;
string subcategoryname = em.subcategname;
NavigationService.Navigate(new Uri(String.Format("/SubCategories.xaml?id=" + id + "&categoryid=" + categoryid + "&subcategoryname=" + subcategoryname), UriKind.Relative));
}
}
如果列表中有 2 个项目,如果单击第一项,则能够导航到子类别页面。但再次单击相同的第一项无法导航。如果单击第一项后单击 2 项,则能够导航到子类别页面。 ……