title: Execute code when a WPF closes
body: <p>I am not familiar with using event handlers, and I was wondering if anyone had or could direct me to some code that shows how to use an event handler that will execute code on the Close/Closed event?</p>
  
  <p>I know this can be done because of this answered question:</p>
  
  <p><a href="https://stackoverflow.com/questions/1374528/run-code-on-wpf-form-close">Run code on WPF form close</a></p>
  
  <p>But I need some direction.</p>
  
  <p>Thank you =)</p>