ObservableCollection not noticing when Item in it changes (even with INotifyPropertyChanged)

前端 未结 18 2909
一生所求
一生所求 2020-11-22 02:06

Does anyone know why this code doesn\'t work:

public class CollectionViewModel : ViewModelBase {  
    public ObservableCollection Con         


        
18条回答
  •  春和景丽
    2020-11-22 02:50

    I know that I'm too late for this party, but maybe - it will help to someone..

    Here you can find my implementation of ObservableCollectionEx. It has some features:

    • it supports everything from ObservableCollection
    • it's thread safe
    • it supports ItemPropertyChanged event (it raises each time when Item.PropertyChanged item is fired)
    • it supports filters (so, you could create ObservableCollectionEx, pass another collection as Source to it, and Filter with simple predicate. Very useful in WPF, I use this feature a lot in my applications). Even more - filter tracks changes of items via INotifyPropertyChanged interface.

    Of course, any comments are appreciated ;)

提交回复
热议问题