public void Dispose()
            {
                _collection._deferredEvents = null;
                ILookup <bool, NotifyCollectionChangedEventHandler> handlers = _collection.GetHandlers().ToLookup(h => h.Target is CollectionView);

                foreach (NotifyCollectionChangedEventHandler handler in handlers[false])
                {
                    foreach (NotifyCollectionChangedEventArgs e in this)
                    {
                        handler(_collection, e);
                    }
                }

                foreach (CollectionView cv in handlers[true].Select(h => h.Target)
                         .Cast <CollectionView>()
                         .Distinct())
                {
                    cv.Refresh();
                }
            }
예제 #2
0
            public void Dispose()
            {
                _collection._deferredEvents = null;

                var handlers = _collection
                               .GetHandlers()
                               .ToLookup(h => h.Target is CollectionView);

                foreach (var handler in handlers[false])
                {
                    foreach (var e in this)
                    {
                        handler(_collection, e);
                    }
                }

                foreach (var cv in handlers[true]
                         .Select(h => h.Target)
                         .Cast <CollectionView>()
                         .Distinct())
                {
                    cv.Refresh();
                }
            }