title: Linking IronPython to WPF
body: <p>I just installed VS2010 and the great new <a href="http://ironpython.net/tools/" rel="nofollow noreferrer">IronPython Tools</a> extension. <a href="https://stackoverflow.com/questions/2996854/cant-add-events-for-controls-in-wpf-ironpython-vs2010/3000618#3000618">Currently</a> this extension doesn't yet generate event handlers in code upon double-clicking wpf visual controls. Is there anyone that can provide or point me to an example as to how to code wpf event handlers manually in python. I've had no luck finding any and I am new to visual studio.</p>
  
  <p>Upon generating a new ipython wpf project the auto-generated code is:</p>
  
  <pre><code>import clr
  clr.AddReference('PresentationFramework')
  
  from System.Windows.Markup import XamlReader
  from System.Windows import Application
  from System.IO import FileStream, FileMode
  
  app = Application()
  app.Run(XamlReader.Load(FileStream('WpfApplication7.xaml', FileMode.Open)))
  </code></pre>
  
  <p>and the XAML is:</p>
  
  <pre><code>&lt;Window 
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
         Title="WpfApplication7" Height="300" Width="300"&gt; 
         &lt;Button&gt;Click Me&lt;/Button&gt;
  &lt;/Window&gt; 
  </code></pre>
  
  <p>Any help would be appreciated.</p>