WPF: Detect when selected item changes
I have a control that is data-bound to a ListBox
. 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开发者_如何学JAVA?
You can also bind to the SelectedItem
property, say with ICollectionView.CurrentItem
, and set the IsSynchronizedWithCurrentItem
property to True.
There is SelectionChanged event in ListBox.
精彩评论