[Ironruby-core] How to run a XAML file?

Kevin Radcliffe lists at ruby-forum.com
Fri Jul 24 11:38:40 EDT 2009

Shay Friedman wrote:
> Hi,
> I have a WPF xaml file and I'd like to execute it using IronRuby. I know
> I can use the System::Windows::Markup::XamlReader.parse method, but is
> there another way?
> Using the XamlReader class makes registering events, for example, kind
> of an irritating task.
> Thanks,
> Shay.

Yes, there is a 'Wpf.rb' in your \Samples\Tutorial directory (This 
should exist for you if you have a source copy, or the regular 0.6 

This adds a number of helpers to make working with XAML easier.
I haven't looked at it extensively, but I'd say you can probably learn 
what is doing by running the wpf tutorial in that dir, and following the 
Look for the "load" methods associated with xaml to get an idea of what 
helpers are added.

Also, if you are trying to do something simple, and the XAML is actually 
getting in the way, Thibaut Barrère's "magic" looks to be a very nice 
DSL for this:

Posted via http://www.ruby-forum.com/.

More information about the Ironruby-core mailing list