title: WPF code-behind for resources?
body: <p>I'm working on a wpf application, and up until recently, I had a ResourceDictionary inside my main window's resources part of the xaml.  The resource dictionary contained an DataTemplate that was used to style several listboxes in the window.  The xaml for this datatemplate contained pointers to event handlers, eg:</p>
  
  <pre><code>&lt;Button n:Name="btnClickMe" Content="Click Me!" LeftMouseButtonUp="btnClickMe_Click" /&gt;
  </code></pre>
  
  <p>I recently decided to split the content of the window up into separate user controls, and to move my ResourceDictionary into it's own file.  But, of course, there isn't a code-behind file for a resource dictionary file.  How can I wire this up, with things split up as I've described?</p>
  
  <p>Thanks in advance!</p>