Using the EventToCommand behaviour that comes with MVVM Light I am binding the SelectedItem of a ListBox to a RelayCommand on a ViewModel
All works great in my Windows Phone 7 app except that after navigating away from the View with the ListBox then back the SelectedItem is the same as before. Not what I want.
I tried reseting the selected index when navigating away but that causes the Command to trigger again.
Has anyone else solved this issue and how?
TIA
Patrick Long
I switched away from using the SelectionChanged event. Now I do it all with TapGestures. Downside of this is that TapGesture does not work with EventToCommand behaviour so I am trapping the Gesture event in the View and firing the Command that is bound to the DataContext of the Sender.
IMHO this is a lot neater than using SelctionChanged and mucking about with SelectedIndexes.