I have a ListView that is bound to an Observable Collection of some object.. Selecting and item in the ListView displays a form. My business case is such when user toggles from one item to other in ListView and if there are any unsaved changes, user should be prompted of Yes/No/Cancel. If the user clicks on No then, the selected item should be removed from the List.
I have a ViewModel for the ListViewItem and inside IsSelected property I am prompting the user. Now when I remove the item from the Observable Collection, the IsSelected = True for the next time that is getting selected, I am getting error..
"Collection was modified; enumeration operation may not execute"..