WPF TextBox interceptando RoutedUICommands

Estoy intentando que funcionen los atajos de teclado de Deshacer / Rehacer en mi aplicación WPF (tengo mi propia funcionalidad personalizada implementada usando elPatrón de comando). Parece, sin embargo, que laTextBox el control está interceptando mi "Deshacer" RoutedUICommand.

¿Cuál es la forma más sencilla de deshabilitar esto para poder detectar Ctrl + Z en la raíz de mi árbol de IU? Me gustaría evitar poner una tonelada de código / XAML en cada unoTextBox en mi aplicación si es posible.

Lo siguiente demuestra brevemente el problema:

<Window x:Class="InputBindingSample.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:loc="clr-namespace:InputBindingSample"
    Title="Window1" Height="300" Width="300">
    <Window.CommandBindings>
        <CommandBinding Command="loc:Window1.MyUndo" Executed="MyUndo_Executed" />
    </Window.CommandBindings>
    <DockPanel LastChildFill="True">
        <StackPanel>
            <Button Content="Ctrl+Z Works If Focus Is Here" />
            <TextBox Text="Ctrl+Z Doesn't Work If Focus Is Here" />
        </StackPanel>
    </DockPanel>
</Window>
using System.Windows;
using System.Windows.Input;

namespace InputBindingSample
{
    public partial class Window1
    {
        public static readonly RoutedUICommand MyUndo = new RoutedUICommand("MyUndo", "MyUndo", typeof(Window1),
            new InputGestureCollection(new[] { new KeyGesture(Key.Z, ModifierKeys.Control) }));

        public Window1() { InitializeComponent(); }

        private void MyUndo_Executed(object sender, ExecutedRoutedEventArgs e) { MessageBox.Show("MyUndo!"); }
    }
}

Respuestas a la pregunta(6)

Su respuesta a la pregunta