title: Escape button on C# console application
body: <p>Hi guys I bet I'm being really stupid. Can you help me get rid of the errors? Sorry for this I'm a student new to learning c#. Do I need to declare any variables to correct the logic?</p>
  
  <pre><code>void WindowCloseOnEsc_KeyDown(object sender, KeyEventArgs e)   
  {
      if (e.Key == Key.Escape)
      {
           Close();
      }
  
  }
  </code></pre>