I was wondering if there's a way to watch all RoutedEvents that are raised in a WPF application. A way to write some info about the events fired to the console would be prefect to see what's going on.
相关问题
- VNC control for WPF application
- Pass custom debug information to Microsoft bot fra
- WPF Binding from System.Windows.SystemParameters.P
- How do I identify what code is generating “ '&
- XAML: Applying styles to nested controls
Yes, but it requires some reflection. You're better off using a tool like Snoop that already does the hard lifting for you.
In the tab Events you can see list of events, and the element that handled it.
I've found another way:
I've added this to the loaded handler of my UserControl.
and this is the handler method:
The CanExecute events are a bit too much in my case. If you would like to see these too, just remove the if statement.