I have a List View which has a Selected Item that works the first time I use it.
However, when I clear the List View and re-bind it to another Collection, the selected item no longer appears selected.
Just when the collection changes (add/remove items) will the listbox be notified. If your IItem implementation is being provided by your database then you have to use whatever mechanism your database code provides to allow you to inject property notification into the objects it creates (I personally use Castle Dynamic Proxy to do this with NHibernate).
The alternative is to create a wrapper for each of your data models in the viewmodel and add that functionality yourself.
I've done that 1298736 times before, but in this case it does not work.
Here is the Button that opens the Popup on Click: ...
Currently, to make a this function, I use detour way. All items that I select is accumulated just in "lb Loaded Items" I'll consider more your recommendation. You're setting the reference to the object Item List to a new instance, rather than updating the items on the list that WPF is already hooked up to.
Right now listview Selected Item will update only if the user's click on a row is just outside the textbox.
If I click the textbox or type in it, the highlighted row stays the same and no Selection Changed occurs for the listview.
Observable Collection only notifies the collection changes not the changes in each of the item.
In order to achieve your goal one of options is to change the IItem from interface to a class which implements INotify Property Changed interface (or implement it in the IItem concrete type), and hook it with the View Model's Property Changed delegate (remember to unsubscribe it).
I had to add in a couple lines because the previous item was not getting unselected protected void Select Current Item(object sender, Keyboard Focus Changed Event Args e) Thanks so much!