I have a control that is data-bound to a list box. All of the bound properties are being updated correctly. However, the control needs to know when the selected item changes so that it can do some other cleanup. Is there an event that covers this?
No good. The detail control and the listbox don't know anything about each other. I need to do this entirely within the detail control.
Jonathan Allen
2010-01-26 08:29:59
+2
A:
You can also bind to the SelectedItem
property, say with ICollectionView.CurrentItem
, and set the IsSynchronizedWithCurrentItem
property to True.
codekaizen
2010-01-26 07:59:29
You can listen to the underlying collection's `CurrentChanged` event.
codekaizen
2010-01-26 08:32:18
Ok, I see now. I use the CollectionViewSource.GetDefaultView(DataContext) to get the view, and that view is your ICollectionView.
Jonathan Allen
2010-01-26 09:03:09
Stupid website. It won't let me give you an up vote unless you edit your answer.... or I can edit it without changing anything.
Jonathan Allen
2010-01-26 09:04:11