I am trying to get Undo/Redo keyboard shortcuts working in my WPF application (I have my own custom functionality implemented using the Command Pattern). It seems, however, tha
The Executed event bubbles up, so the Window Executed event will always be hit after the TextBox Executed event. Try changing it to PreviewExecuted and it should make a huge difference. Also, you might need to hook up a CanExecute for your window as well. ie:
private void SomeOtherFunction(object sender, ExecutedRoutedEventArgs e) { e.CanExecute=true; }
Of course you'll probably want some logic in there to determine when CanExecute should be set to true. You probably don't need to use a custom command either (just use the built-in Undo).