[Ironruby-core] Databinding in WPF against IronRuby objects

Shay Friedman
Sat, 31 Jul 2010 05:35:30 -0000

I find IronRuby types hard-to-work-with sometimes when it comes to WPF data
binding. What I do as a workaround is creating the data entity classes in C#
and initialize them from IronRuby code.

To fix your sample WPF app, I used the CLR string instead of
IronRuby''s. So
instead of:

    def initialize
      @ImageLocation =
"http://www.ironruby.net/@api/deki/site/logo.png"
    end

You need to do:

    def initialize
      @ImageLocation
"http://www.ironruby.net/@api/deki/site/logo.png".to_clr_string
    end


Shay.


On Sat, Jul 31, 2010 at 4:08 AM, Brian Genisio <briangenisio at
gmail.com>wrote:

> All,
>
> I posted this on StackOvervlow, but I thought I would notify this list of
> my question, in case someone here understands what is going on...
>
> Basically, I am finding that data binding to properties on IronRuby objects
> works for some controls, but fails on others. I have an example of it here:
>
>
>
http://stackoverflow.com/questions/3376349/why-does-some-wpf-binding-fail-against-ironruby-properties
>
> Anyone have any idea why this happens?
> Brian
>
> _______________________________________________
> Ironruby-core mailing list
> Ironruby-core at rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/ironruby-core/attachments/20100731/89bf2b73/attachment.html>