如果我创建一个新的
为什么
ObservableCollection<T>
,并添加如下CollectionChanged
监听器:var c = new ObservableCollection<MyType>();
c.CollectionChanged += new NotifyCollectionChangedEventHandler(h);
...
void h(object sender, NotifyCollectionChangedEventArgs e)
{
IList newItems = e.NewItems;
// non generic IList! :(
}
为什么
e.NewItems
不是IList<MyType>
?
NotifyCollectionChangedEventHandler
,那么我就做错了™。 - funkybroINotifyPropertyChanged
),包含一个“子”VMs 的ObservableCollection
,每个子 VM 也实现了INotifyPropertyChanged
。我需要监听集合中任何项的更改,以触发基类中属性的PropertyChanged
。也许这需要自己的问题! - funkybro