Is there a way to use Ruby and WPF?

I found "Ruby in Steel", but this (I think) only works with visual studio 2008 and does not support the new WPF / XAML.

Is there such a thing or these dreams? :)

+4
source share
2 answers

See the DiskUse project in the IronRuby 1.1\Samples\ directory. It uses WPF and XAML. For example, how they load xaml:

 module DialogUtil def load_xaml(filename) f = IO::FileStream.new(filename, IO::FileMode.Open, IO::FileAccess.Read) begin element = Markup::XamlReader::Load(f) ensure f.close end element end module_function :load_xaml end 

and then using it:

 @window = DialogUtil.load_xaml("mainWindow.xaml") @window.closing { @app.shutdown } @windowTitle = @window.title ... @window.show 

And yes, it works fine with VS2010 - http://ironruby.codeplex.com/

+5
source

The main installer for IronRuby supports VS 2010. It also supports Silverlight, but does not seem to support WPF.

Perhaps it can be used by manually editing the project file and entering the template code, which VS usually generates on its own.

EDIT: After some testing, you can easily use WPF from Iron Ruby, but you cannot directly use XAML.

0
source

All Articles