title: How can I assign the 'Close on Escape-key press' behavior to all WPF windows within a project?
body: <p>Is there any straightforward way of telling the whole WPF application to react to Escape key presses by attempting to close the currently focused widow? It is not a great bother to manually setup the command- and input bindings but I wonder if repeating this XAML in all windows is the most elegant approach?</p>
  
  <pre><code>&lt;Window.CommandBindings&gt;
          &lt;CommandBinding Command="Close" Executed="CommandBinding_Executed" /&gt;
  &lt;/Window.CommandBindings&gt;
  &lt;Window.InputBindings&gt;
          &lt;KeyBinding Key="Escape" Command="Close" /&gt;
  &lt;/Window.InputBindings&gt;
  </code></pre>
  
  <p>Any constructive suggestions welcome!</p>