Here's my code:
var commandBinding = new CommandBinding(ApplicationCommand.New);
commandBinding.PreviewExecuted += OnPreviewExecuted;
commandBinding.Executed += OnExecuted;
CommandBindings.Add(commandBinding);
void OnPreviewExecuted(object sender, ExecutedRoutedEventArgs e) {
e.Handled = false;
}
void OnExecuted(object sender, ExecutedRoutedEventArgs e) {
DoSomething();
}
MSDN says:"...If the preview event is not handled, the Executed event is raised on command target."
This does work correctly for the PreviewCanExecute event. But in this case the Executed-Event will not get called when a PreviewExecuted-Event is listening.
I did not find anything around this topic so I want to ask, whether the behavior is intended or just incorrect.