Let's imagine I have XAML that looks like this:
<UserControl.CommandBindings>
<CommandBinding Command="ApplicationCommands.Delete" Executed="CommandBinding_DeleteExecuted" PreviewExecuted="CommandBinding_PreviewDeleteExecuted"/>
</UserControl.CommandBindings>
And I have C# code that looks like this:
private void CommandBinding_DeleteExecuted(object sender, ExecutedRoutedEventArgs e)
{
}
private void CommandBinding_PreviewDeleteExecuted(object sender, ExecutedRoutedEventArgs e)
{
//Would like to invoke Delete command from here
}
What I would like to do is have my preview handler get called and do some custom check. If the custom check passes, then I would like to invoke the delete command again, from within the preview handler (or rather than invoking, if I could have the original command pass 'through' my preview and execute handlers, that would be great). So, at this point, when I re-issue the delete command, no further XAML is involved.
If I reissue the Delete command from my preview handler somehow, I imagine it would result in the preview handler being called again (endlessly in a loop). Instead, I would like to have the re-issued command ignore my preview and execute handler and let any delete commands handler further down in the tree handle the delete command.
Is there any way to do this?