Question

I have a WPF form and I am working with databinding. I get the events raised from INotifyPropertyChanged, but I want to see how to get a list of what items are listening, which i fire up the connected handler.

How can I do this?

OTHER TIPS

What do you mean with the Items that are listening ?

Do you want to know which controls are databound to your property , or do you want to have a list of eventhandlers that are wired to the PropertyChanged event ?

The latter can be done by calling GetInvocationList on the event.

Call GetInvocationList() on your event instance. U'll get an array of delegates (if any): Delegate[]. For each delegate u can inspect the Method property - to get the MethodInfo of the method that acts as the listener; or the Target property - to get the instance of the object on witch the listener method is defined

Thanks for the answers all, I managed to track it down to null references on a different property (quite a lucky find!)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top