[IronPython] WPF objects not available?

Martin Maly Martin.Maly at microsoft.com
Tue Jun 12 22:03:48 CEST 2007


You need to add references to the WPF assemblies from IronPython. There's a section on how to use WPF from IronPython in the tutorial which is part of the distribution.

The code you need is roughly (emphasizing roughly, because "from module import *" is best avoided for possible name clashes)

import clr

clr.AddReferenceByPartialName("PresentationCore")
clr.AddReferenceByPartialName("PresentationFramework")
clr.AddReferenceByPartialName("WindowsBase")
clr.AddReferenceByPartialName("IronPython")
clr.AddReferenceByPartialName("Microsoft.Scripting")

from math import *
from System import *
from System.Windows import *
from System.Windows.Media import *
from System.Windows.Media.Animation import *
from System.Windows.Controls import *
from System.Windows.Shapes import *

Martin


From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of mike arty
Sent: Tuesday, June 12, 2007 12:45 PM
To: users at lists.ironpython.com
Subject: [IronPython] WPF objects not available?

This question may be off-topic. I'm using IronPython to work w/Net. I recently installed the .Net 3.0 framework and the C# SDK, but the only object I have available in System.Windows is Forms. I'm not seeing any of the new WPF modules, .Media, etc...

Any ideas? WPF is included w/the .Net 3.0 install from the MSDN web site right?

Input greatly appreciated!

-mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20070612/f0e5a67a/attachment.html>


More information about the Ironpython-users mailing list