title: How to use an accesskey on a WPF Button with a custom ContentTemplate?
body: <p><strong>Scenario:</strong></p>
  
  <p>Currently I have this XAML code:</p>
  
  <pre><code>&lt;Button Content="_Cancel" IsCancel="True" Command="{Binding Path=CancelCommand}" Margin="5"&gt;
     &lt;Button.ContentTemplate&gt;
        &lt;DataTemplate&gt;
           &lt;TextBlock Margin="10,0,10,0" /&gt;
        &lt;/DataTemplate&gt;
     &lt;/Button.ContentTemplate&gt;
  &lt;/Button&gt;
  </code></pre>
  
  <p>Obviously the accesskey (the 'c' key: _Cancel) doesn't work in combination with the TextBlock. I actually think the TextBlock should be a ContentPresenter (below), but this crashes my Visual Studio 2010 instance every time.</p>
  
  <pre><code>&lt;ContentPresenter Margin="10,0,10,0" RecognizesAccessKey="True" /&gt;
  </code></pre>
  
  <p><strong>Question:</strong></p>
  
  <ul>
  <li>What's the best solution to use accesskeys on a WPF Button with a ContentTemplate?</li>
  </ul>
  
  <p>Thanks in advance!</p>