public ItemDependency(string propertyPath, IBindableCollection <TElement> sourceElements, IPathNavigator pathNavigator) { _pathNavigator = pathNavigator; _sourceElementObservers = new Dictionary <TElement, IToken>(); _propertyPath = propertyPath; _sourceElements = sourceElements; _actioner = new ElementActioner <TElement>(sourceElements, AddItem, RemoveItem, sourceElements.Dispatcher); }
private void ChildCollectionAdded(IBindableCollection <TElement> collection) { _childCollectionActioners[collection] = new ElementActioner <TElement>( collection, item => ResultCollection.Add(item), item => ResultCollection.Remove(item), Dispatcher); }
private void WireInterceptor(IBindableCollection <TElement> source) { _source = source; _source.CollectionChanged += _weakHandler.Handler; _propertyChangeObserver = new PropertyChangeObserver(Element_PropertyChanged); _addActioner = new ElementActioner <TElement>(_source, element => _propertyChangeObserver.Attach(element), element => _propertyChangeObserver.Detach(element), Dispatcher); }
/// <summary> /// Initializes a new instance of the <see cref="UnionIterator<TElement>"/> class. /// </summary> /// <param name="elements">The elements.</param> /// <param name="dispatcher">The dispatcher.</param> public UnionIterator(IBindableCollection <IBindableCollection <TElement> > elements, IDispatcher dispatcher) : base(elements, dispatcher) { // A map of actioners for each of the collections being unioned _childCollectionActioners = new Dictionary <IBindableCollection <TElement>, ElementActioner <TElement> >(); // An actioner that invokes the Added/Removed delegates each time a collection is added to the list of // collections being unioned _rootActioner = new ElementActioner <IBindableCollection <TElement> >( SourceCollection, ChildCollectionAdded, ChildCollectionRemoved, Dispatcher); }
public UnionIterator(IBindableCollection <IBindableCollection <TElement> > elements, IDispatcher dispatcher) : base(elements, dispatcher) { _childCollectionActioners = new Dictionary <IBindableCollection <TElement>, ElementActioner <TElement> >(); _rootActioner = new ElementActioner <IBindableCollection <TElement> >(SourceCollection, ChildCollectionAdded, ChildCollectionRemoved, Dispatcher); }