Linking IronPython to WPF

Posted by DonnyD on Stack Overflow See other posts from Stack Overflow or by DonnyD
Published on 2010-06-16T20:46:41Z Indexed on 2010/06/16 20:52 UTC
Read the original article Hit count: 327

I just installed VS2010 and the great new IronPython Tools extension. Currently 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.

Upon generating a new ipython wpf project the auto-generated code is:

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)))

and the XAML is:

<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"> 
       <Button>Click Me</Button>
</Window> 

Any help would be appreciated.

© Stack Overflow or respective owner

Related posts about python

Related posts about beginner