[Ironruby-core] Data Binding to IronRuby Objects in WPF

Ivan Porto Carrero ivan at flanders.co.nz
Mon Jul 20 10:26:48 EDT 2009

but wouldn't linking those to attr_reader, attr_writer and attr_accessor
work?At least then you know which things are meant to be properties.

I don't mind using something like clrattr_reader etc.
to get a different behavior and something to expand upon. because then
it becomes
inotify_attr_reader or
something, later on for INotifyPropertyChanged implementations.
Met vriendelijke groeten - Best regards - Salutations
Ivan Porto Carrero
GSM: +32.486.787.582
Blog: http://flanders.co.nz
Twitter: http://twitter.com/casualjim
Author of IronRuby in Action (http://manning.com/carrero)

On Mon, Jul 20, 2009 at 4:10 PM, Curt Hagenlocher <curth at microsoft.com>wrote:

> This should work under desktop WPF (though not under Silverlight) because
> IronRuby objects implement ICustomTypeDescriptor. But consider the following
> code:
> class Drive
>  def letter
>    'C'
>  end
>  def format
>    # format the hard drive
>  end
> end
> How do we know what the "properties" of Drive are? For obvious reasons, we
> would want to return "letter" but not "format". The way I protected against
> this was to return only those names which have both an arity 0 getter and an
> arity 1 setter. In other words, the above class would also need a
>  def letter= value
>    # raise some kind of "not supported" exception
>  end
> in order for the ICustomTypeDescriptor implementation to recognize "letter"
> as a property.
> -----Original Message-----
> From: ironruby-core-bounces at rubyforge.org [mailto:
> ironruby-core-bounces at rubyforge.org] On Behalf Of Shay Friedman
> Sent: Saturday, July 18, 2009 9:12 AM
> To: ironruby-core at rubyforge.org
> Subject: [Ironruby-core] Data Binding to IronRuby Objects in WPF
> Hi there,
> I'm trying to databind IronRuby objects to a WPF listbox with no success
> My data is a Ruby array of objects. The array seems to be bound fine as
> I see the expected number of rows in the listbox. However, every object
> within the array fails to bind correctly. I tried the object to be a
> Ruby hash or a custom class without success… WPF wouldn't display the
> correct value.
> When I tried to create an array of CLR classes, it worked.
> Will it work in the  future?
> Thanks,
> Shay.
> ----------------------------
> Shay Friedman
> http://www.IronShay.com
> Follow me: http://twitter.com/ironshay
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Ironruby-core mailing list
> Ironruby-core at rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core
> _______________________________________________
> 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/20090720/861bf762/attachment.html>

More information about the Ironruby-core mailing list