Why isn't my CollectionChanged event handler getting called?
I have done some research and other answers on stackoverflow indicate that I need to extend the ObservableCollection<T> class to add PropertyChanged event handlers to each item when an item is added or removed in order to get events when the contents of an item in the collection change... a bit annoying really, but I've implemented this class based on some of those answers:

        public class DeeplyObservableCollection<T> : ObservableCollection<T>
    where T : INotifyPropertyChanged
    {
        public DeeplyObservableCollection()
            : base()
        {
            CollectionChanged += new NotifyCollectionChangedEventHandler(DeeplyObservableCollection_CollectionChanged);
        }
    
        void DeeplyObservableCollection_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            if (e.NewItems != null)
            {
                foreach (Object item in e.NewItems)
                {
                    (item as INotifyPropertyChanged).PropertyChanged += new PropertyChangedEventHandler(item_PropertyChanged);
                }
            }
            if (e.OldItems != null)
            {
                foreach (Object item in e.OldItems)
                {
                    (item as INotifyPropertyChanged).PropertyChanged -= new PropertyChangedEventHandler(item_PropertyChanged);
                }
            }
                
        }
    
        void item_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            NotifyCollectionChangedEventArgs a = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset);
            OnCollectionChanged(a);
        }
    }

As I understand it, the CollectionChanged event will be fired when ever one of the elements fires a PropertyChanged event. This seems to work when I step through the code as I do get stepped into the DeeplyObservableCollection_CollectionChanged method from the item_PropertyChanged method.

So in my code I attach an event handler to the DeeplyObservableCollection_CollectionChanged method like this:

    GroupSettingsList.CollectionChanged += new NotifyCollectionChangedEventHandler(this.ContentCollectionChanged);

GroupSettingsList is a DeeplyObservableCollection and ContentCollectionChanged is a CollectionChanged eventhandler. I don't get any errors but my method never gets called and I'm not sure why.

What do I need to do to get my event handler to be called here?


Why isn't my CollectionChanged event handler getting called?
===

I have done some research and other answers on stackoverflow indicate that I need to extend the ObservableCollection<T> class to add PropertyChanged event handlers to each item when an item is added or removed in order to get events when the contents of an item in the collection change... a bit annoying really, but I've implemented this class based on some of those answers:

        public class DeeplyObservableCollection<T> : ObservableCollection<T>
    where T : INotifyPropertyChanged
    {
        public DeeplyObservableCollection()
            : base()
        {
            CollectionChanged += new NotifyCollectionChangedEventHandler(DeeplyObservableCollection_CollectionChanged);
        }
    
        void DeeplyObservableCollection_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            if (e.NewItems != null)
            {
                foreach (Object item in e.NewItems)
                {
                    (item as INotifyPropertyChanged).PropertyChanged += new PropertyChangedEventHandler(item_PropertyChanged);
                }
            }
            if (e.OldItems != null)
            {
                foreach (Object item in e.OldItems)
                {
                    (item as INotifyPropertyChanged).PropertyChanged -= new PropertyChangedEventHandler(item_PropertyChanged);
                }
            }
                
        }
    
        void item_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            NotifyCollectionChangedEventArgs a = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset);
            OnCollectionChanged(a);
        }
    }

As I understand it, the CollectionChanged event will be fired when ever one of the elements fires a PropertyChanged event. This seems to work when I step through the code as I do get stepped into the DeeplyObservableCollection_CollectionChanged method from the item_PropertyChanged method.

So in my code I attach an event handler to the DeeplyObservableCollection_CollectionChanged method like this:

    GroupSettingsList.CollectionChanged += new NotifyCollectionChangedEventHandler(this.ContentCollectionChanged);

GroupSettingsList is a DeeplyObservableCollection and ContentCollectionChanged is a CollectionChanged eventhandler. I don't get any errors but my method never gets called and I'm not sure why.

What do I need to do to get my event handler to be called here?

