title: WPF set attached event programmatically
body: <p>How do you do this programmatically in WPF?</p>
  
  <pre><code>&lt;window Validation.Error="ItemError"&gt;&lt;/Window&gt;
  </code></pre>
  
  <p>I am trying to set the attached event for Validation.Error through code, but cannot quite figure out how to do it.</p>