[IronPython] how to use IronPython in Silverlight 2

Dino Viehland dinov at exchange.microsoft.com
Fri Mar 7 04:55:41 CET 2008


You'll need to download the Silverlight 2 SDK.  After installing that you'll get all the necessary components installed into something like C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Libraries\Client.  Also installed is an extremely useful tool called Chiron which you'll find somewhere around C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Tools\Chiron.  Chiron can take your .py file and produce a .xap which includes the IronPython & DLR DLLs using the /zipdlr command line option.  You can also use it to serve http requests and automatically serve up the .xap and let you just edit the files.

So once you're ready to make your xap the directory you point at should contain a .py file (I'm not sure what the multi .py file experience is like, but w/ a single file the it doesn't seem the name matters).    The simplest thing to put in there is:

from System.Windows import Application
from System.Windows.Markup import XamlReader

Application.Current.RootVisual = XamlReader.Load("someXaml")

You can see this from the Ruby perspective over at http://www.iunknown.com/2008/03/dynamic-silverl.html

There's various options on how to deploy the DLLs, and you can get into manifest files to deploy additional DLLs, but hopefully that'll get you started.


From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Kevin Chu
Sent: Thursday, March 06, 2008 7:39 PM
To: Discussion of IronPython
Subject: [IronPython] how to use IronPython in Silverlight 2

Silverlight 2 beta1 tools for VS2008 only create C# code file,
How to create a IronPython code file?

--
Once in a Redmoon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20080306/cdcf4c06/attachment.html>


More information about the Ironpython-users mailing list