Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 private void ChildCollectionAdded(IBindableCollection <TElement> collection)
 {
     _childCollectionActioners[collection] = new ElementActioner <TElement>(
         collection,
         item => ResultCollection.Add(item),
         item => ResultCollection.Remove(item),
         Dispatcher);
 }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UnionIterator&lt;TElement&gt;"/> 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);
        }
Exemplo n.º 5
0
 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);
 }