1
Vote

XxxChangedPropertyObservation does not handle EventHandler<EventArgs>

description

XxxChangedPropertyObservation does not handle EventHandler<EventArgs> but only base EventHandler.
I can suggest this update:

public XxxChangedPropertyObservation(EventDescriptor changedEvent, object obj)
            {
                if (changedEvent.EventType == typeof(EventHandler<EventArgs>))
                {
                    changedEvent.AddEventHandler(obj, (EventHandler<EventArgs>)OnPropertyValueChanged);
                }
                else if (changedEvent.EventType == typeof(EventHandler))
                {
                    changedEvent.AddEventHandler(obj, (EventHandler)OnPropertyValueChanged);
                }
            }

comments

xlegalles wrote Sep 3, 2014 at 3:43 PM

Maybe one more comment: I have found such a case using DevExpress