Пример #1
0
        public EnhancedObservableCollection(IEnumerable <T> collection, CollectionOptions options)
            : base(collection)
        {
            _options = options;
            collection?.ForEach(subscribeToPropertyChanged);

            _suppressNotification.Deactivated +=
                () => OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
            _suppressItemPropertyChangedNotifications.Deactivated +=
                () =>
            {
                foreach (var e in _awaitingItemPropertyChangedEvents)
                {
                    if (this.Contains(e.Item))
                    {
                        ItemPropertyChanged?.Invoke(this, e);
                    }
                }
                _awaitingItemPropertyChangedEvents.Clear();
            };
        }
Пример #2
0
 public EnhancedObservableCollection(CollectionOptions options)
     : this(new T[0], options)
 {
 }