title: C# WPF - How to Bind TextBox Enter Key Press to a Method?
body: <p>I have a <code>TextBox</code> with an 'OK' button below it. The 'OK' button runs the method in my <code>RunPanel</code> static class like this: <code>RunPanel.RunOK();</code>.</p>
  
  <p>I would like pressing <kbd>enter</kbd> in the <code>TextBox</code> to also execute the method <code>RunPanel.RunOK()</code>.</p>
  
  <p>How could I do this in XAML?</p>
  
  <p>The answers I have come across seem confusing, so I was wondering if someone could help me out.</p>