private void registerSourceItem(ItemInfo itemInfo, INotifyCollectionChanged source) { itemInfo.Source = source; if (source != null) { itemInfo.SourceAsINotifyPropertyChanged = (INotifyPropertyChanged) source; itemInfo.SourcePropertyChangedEventHandler = (sender, args) => Utils.HandleSourcePropertyChanged(args, ref itemInfo.IndexerPropertyChangedEventRaised); itemInfo.SourceAsINotifyPropertyChanged.PropertyChanged += itemInfo.SourcePropertyChangedEventHandler; itemInfo.SourceNotifyCollectionChangedEventHandler = (sender, eventArgs) => handleSourceCollectionChanged(sender, eventArgs, itemInfo); source.CollectionChanged += itemInfo.SourceNotifyCollectionChangedEventHandler; IHasChangeMarker sourceAsIHasChangeMarker = source as IHasChangeMarker; itemInfo.SourceAsIHasChangeMarker = sourceAsIHasChangeMarker; if (sourceAsIHasChangeMarker != null) { itemInfo.LastProcessedSourceChangeMarker = sourceAsIHasChangeMarker.ChangeMarker; } } initializeSourceCopy(itemInfo); }
void ISourceIndexerPropertyTracker.HandleSourcePropertyChanged(object sender, PropertyChangedEventArgs propertyChangedEventArgs) { Utils.HandleSourcePropertyChanged(propertyChangedEventArgs, ref _indexerPropertyChangedEventRaised); }