Data Binding?

Is it possible to use databinding from within IronRuby? In this case, I
want to have a field, @volume on one class, and listen for changes on
another class.

You can’t databind to DLR objects at the moment. You have to define the
properties you want to bind to as strong typed classes.

The IronNails project I mentioned earlier tries to alleviate all of that

What you can do is define one class in C# to which you want to bind from
within your control/window
You can define one property in that C# class something like objects. I
my properties to be from the type ObservableDictionary


public class ViewModel : INotifyPropertyChanged

public ObservableDictionary<string, object> Objects{
//implement property
//implement class

In IronRuby

public MyWindowViewModel < ViewModel


You can then bind to values in the dictionary something like
vm =
vm.objects[“MyName”] = “The super important text”.to_clr_string
view_proxy.data_context = vm.objects

view_proxy.data_context = vm

You can index into dictionaries and that way you can get around some of
But to bind to properties you need to define those classes in C# at the
moment unfortunately

Hope this helps somewhat

2008/8/15 Sean C. Hess [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs