简体   繁体   中英

WPF - ObservableCollection PropertyChanged event?

I have an object which has a property of type ObservableCollection<bool> . It is bound to a list of checkboxes on a form using TwoWay bindings. I would like to add a PropertyChanged notification to this so that if certain values are selected, some other ones get automatically deselected. Is there a way to do this?

The ObservableCollection.PropertyChanged event doesn't get triggered when a value in the collection gets changed and I'm using the MVVM design pattern.

You would need to use your own class that implements the INotifyPropertyChanged interface. You won't be able to use bool, but you can have a single property in your class that is that bool that you want.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM