|
普通に考えると、VMがCLASS::PropertyChangedを拾う形になるんじゃないでしょうか。
class VM {
public ObservableCollection<CLASS> Items { get; private set; }
public VM() {
Items = new ObservableCollection<CLASS>();
Items.CollectionChanged += this.OnItemsChanged;
}
private void OnItemsChanged(object sender, NotifyPCollecctionChangedEventArgs e) {
if (e.OldItems != null) {
foreach (CLASS item in e.OldItems) {
item.PropertyChanged -= this.OnItemChanged;
}
}
if (e.NewItems != null) {
foreach (CLASS item in e.NewItems) {
item.PropertyChanged += this.OnItemChanged;
}
}
}
private void OnItemChanged(object sender, PropertyChangedEventArgs e) {
CLASS item = (CLASS)sender;
// todo
}
}
|