When I execute a routed command, let's say:
ApplicationCommands.Undo.Execute(null, this);
WPF does some magic to find the proper CommandBinding
on which it executes the ExecutedRoutedEventHandler
.
Is there a way to get a reference to the CommandBinding
(or at least to the handler) that would be executed?
It would sometimes be nice for debugging to know who is handling a command.