Wednesday, June 11, 2008

Dynamic Script Control Update

XAML is an XML markup for describing user interfaces, used in both Windows Presentation Foundation and Silverlight. XAML elements correspond to classes in the UI libraries with element attributes corresponding to properties - meaning there is a direct relationship between XAML describing a UI and the object tree it generates when loaded (and code you could write to create the same UI).

When using a .NET language like C# and VB.NET you can declare new assemblies to be used as namespaces to locate classes used in the XAML - you can define new controls and use their names as XAML elements. Because dynamic languages don't have static assemblies for the XAML Loader to pull classes out of, you can't currently define new controls in IronPython or IronRuby and then use them in XAML.

Ivan Porto Carrero (who is also the author of IronRuby in Action) has created a new project called Dynamic Script Control. It has a static target, so it can be used in XAML, but lets you dynamically initialise the control from a Ruby hash or Python dictionary in the XAML!
This latest release of Dynamic Script Control is fully functional, but is only really tested with IronRuby at the moment. I aim to get it working with IronPython as soon as I have some spare time...

The latest Dynamic Silverlight SDK release is the first release of the DLR in a long time that works with current versions of both IronPython and IronRuby - which is what makes this release possible.

Now that Silverlight 2 Beta 2 is out of the door, future releases of IronPython and IronRuby will include a version compiled for Silverlight - so this is the last release for a while where IronPython and IronRuby both work with a common version of the Dynamic Language Runtime (at least until IronPython and the DLR are out of beta, which will hopefully happen by the end of the summer)...

No comments:

Post a Comment

Note: only a member of this blog may post a comment.