I'm writing a WP8 app. In the mainpage I've a longlistselector, if I tap an item and navigate to another page, when I press the back button from the second page and come back to the mainpage if I tap the same item again nothing happens, but if I tap a different item it works as it should. _Here it is the ode for the function of the listener of the lls
private void MessageList_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (MessageList.SelectedItem == null)
{
return;
}
Contact c = (Contact)MessageList.SelectedItem;
long id = c.ID;
NavigationService.Navigate(new Uri("/ChatPage.xaml?ID=" + id.ToString(), UriKind.Relative));
MessageList.SelectedItem = null;
}
As you can see I've already resetted the selected item, but the lls behaves the same way
Hope you can help me, thanks in advice!
SelectedItem
to null. coming back the list probably thinks you haven't clicked on something new and doesn't setSelectedItem
to the clicked item. Try not setting it tonull
. – Peter Ritchie