I’m creating an WP7-app with a PhoneApplicationPage containing a ListBox.
When the user selects an item in the ListBox another page will be opened.
Now I’m confused a bit: Which ListBox event handler should I use to detect the selection, Tap or SelectionChanged? And how do I get the tapped item in case of Tap?
I would suggest you use the
SelectionChangedevent, this will always register in the correct way if an item is clicked.A benefit of using the
SelectionChangedevent is that you will get SelectionChangedEventArgs which contains useful information.A important thing to do however is to reset the selected index back to -1 when an item has been clicked, otherwise when the user comes back to the page that item is still selected and the item won’t be clickable.