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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of mike arty
Sent: Tuesday, June 12, 2007 12:45 PM
To: users@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
_______________________________________________
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to