Please use TypeDescriptor.GetEvents in DataEventTrigger

Oct 23, 2009 at 3:36 PM
Edited Oct 23, 2009 at 3:40 PM

I have an MVVM framework that wraps my view model before it gets data bound. The wrapper uses the TypeDescriptionProvider attribute to provide an ICustomTypeDescriptor. This is how I inject my own implementation of INotifyPropertyChanged while exposing all of the same properties for data binding.

My framework forwards all events to the view model through the wrapper. This is accomplished by implementing ICustomTypeDescriptor.GetEvents(). DataEventTrigger, however, can not see any of my view model's events. DataEventTrigger is using Type.GetEvent(), which does not honor the custom type descriptor.

Please change DataEventTrigger to instead use TypeDescriptor.GetEvents(). I have tested this change locally and found it to work. I'd be glad to submit a patch, but I do not have permissions to attach to the project so that cpc can create one.


To clarify, I'm referring to WPF only. TypeDescriptor is only available in WPF. I do not have a suggestion that works in Silverlight.