tags:

views:

31

answers:

1

If I execute the explicitly implemented

ICommand.Execute(object parameter)

method on a RoutedCommand , the command is executed as expected. There must be logic within the RoutedCommand to resolve the position from where the command was executed. Maybe it’s done through StackTrace? Probably it's the same as calling RoutedCommand.Execute(parameter,null).

Does someone know more about this topic (logic, reliability) or has a good link to share ?

+2  A: 

If you look at the implementation using Reflector, it looks like it uses Keyboard.FocusedElement to determine the target.

void ICommand.Execute(object parameter)
{
    this.Execute(parameter, FilterInputElement(Keyboard.FocusedElement));
}
Quartermeister