title: Button Click Event on IronPython + Wpf
body: <p>Im new to python and VS and im trying to make a simple GUI with a button.
  Once I click the button I want it to print(5).</p>
  
  <p>The code looks as following but when I click "run" it exits without any action:</p>
  
  <pre><code>import wpf
  
  from System.Windows import Application, Window
  
  class MyWindow(Window):
      def __init__(self):
          wpf.LoadComponent(self, 'WpfApplication1.xaml')
  
      BUTTON.Click += self.Button_Click
      print(5)
  
  def Button_Click(self, sender, e):
      pass
  
  if __name__ == '__main__':
      Application().Run(MyWindow())
  </code></pre>
  
  <p>XAML:</p>
  
  <pre><code>&lt;Window 
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
         Title="WpfApplication1" Height="300" Width="300"&gt; 
         &lt;Grid&gt;
          &lt;Button x:Name="BUTTON" Content="Button" HorizontalAlignment="Left" Margin="101,82,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click" Background="#FFFF1616"/&gt;
      &lt;/Grid&gt;
  &lt;/Window&gt; 
  </code></pre>
  
  <p>Thank you.</p>