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));
}
}
if 2 items are there in list if click on first item then able to navigate to subcategories page.but again click on same first item not able to navigate.if click on 2 item after click on first item then able to navigate to subcategories page…..
You need to set the
PersonalInfoList.SelectedIndexto-1before or after your call toNavigationService.Navigateto reset the selected item.If you are using a LongListSelector, set the
SelectedItemtonull