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.
Thanks

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
:slight_smile:

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
made
my properties to be from the type ObservableDictionary

ie.

public class ViewModel : INotifyPropertyChanged
{

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

In IronRuby

public MyWindowViewModel < ViewModel

end

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

or
view_proxy.data_context = vm

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

Hope this helps somewhat
Ivan

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