title: How to Close a Window in WPF on a escape key
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3863431/how-can-i-assign-the-close-on-escape-key-press-behavior-to-all-wpf-windows-with">How can I assign the &#39;Close on Escape-key press&#39; behavior to all WPF windows within a project?</a>  </p>
  </blockquote>
  
  
  
  <p>I want to close the windows in my wpf project when the user clicks the escape button. I don't want to write the code in every window but want to create a class which can catch the when the user press the escape key.</p>