Saturday, December 27, 2014

Does ObservableCollection.RemoveAt() do two selections?

Don't bind the selectedindex.


This is a bad idea.


Bind the selecteditem instead.


You then do



myObservableCollection.Remove(SelectedItem);

And you can put code in the setter which acts when the user chooses a different selection.


You don't need to use the index to find the item that is selected, because it is the selecteditem.




Please don't forget to upvote posts which you like and mark those which answer your question.

My latest Technet article - Dynamic XAML


No comments:

Post a Comment