title: WPF Textbox not allowing Undo when hosted in an ElementHost within a VSTO/Outlook add-in
body: <p>I have an Outlook addin (VSTO), on an Outlook form region I have a WPF user control within an ElementHost.  I have an issue that a TextBox within my user control does not have the undo capability... in some configurations.  Specifically in Windows 7 / Outlook 2007 undo (ie Ctrl-Z) does not work, even though Cut/Copy etc all do work.  Interestingly Windows 8 / Outlook 2010 undo does work.</p>
  
  <p>The TextBox XAML is:</p>
  
  <pre><code>&lt;TextBox 
      Name="txtnote" 
      VerticalScrollBarVisibility="Auto" 
      SpellCheck.IsEnabled="True"  
      Text="Topic notes..." 
      TextWrapping="Wrap" 
      AcceptsReturn="True" /&gt;
  </code></pre>
  
  <p>Note: I have tried setting the following attributes to make it work but to no avail: IsUndoEnabled="True" UndoLimit="-1"</p>
  
  <p>Can anyone suggest why this is happening and what I can do to make it work as expected?</p>
  
  <p><strong>UPDATE 7 Jan 2014.</strong>  I have added the following KeyBindings to the text box:</p>
  
  <pre><code>&lt;TextBox.InputBindings&gt;
      &lt;KeyBinding Command="ApplicationCommands.Undo" Key="Z" Modifiers="Control" /&gt;
      &lt;KeyBinding Command="ApplicationCommands.Redo" Key="Y" Modifiers="Control" /&gt;
      &lt;KeyBinding Command="ApplicationCommands.Undo" Key="G" Modifiers="Alt" /&gt;
  &lt;/TextBox.InputBindings&gt;
  </code></pre>
  
  <p>And the result is - Cntl-Z/Cntrl-Y still does not work, <strong>however Alt-G does work!</strong></p>