Re: [Ironruby-core] data binding in Silverlight 4

2010-10-07 Thread Miguel Madero
Hi Ivan, Could you expand a bit on your approach? For what I noticed it defines readers, writters and implements INPC. That's ok for WPF, but I don't see how that would help in Silverlight. I'm probably missing something. Thanks Miguel On Wed, Sep 29, 2010 at 4:44 PM, Ivan Porto Carerro wrote:

Re: [Ironruby-core] data binding in Silverlight 4

2010-09-28 Thread Ivan Porto Carerro
you can always check out my ironnails project that does it for wpf and uses dictionaries. http://github.com/casualjim/ironnails The databinding approach I used should work in silverlight too On Tue, Sep 28, 2010 at 10:23 PM, Christopher Bennage < christop...@bluespireconsulting.com> wrote: > Her

Re: [Ironruby-core] data binding in Silverlight 4

2010-09-28 Thread Brian Genisio
Christopher, My example is in C# using dynamic, but there must be a way to write an Indexer in Ruby that can interop properly. If all else failed, you could write a C# decorator that exposes the Ruby properties dynamically through a string Indexer. Good luck! Let us know what you figure out :)

Re: [Ironruby-core] data binding in Silverlight 4

2010-09-28 Thread Christopher Bennage
Here's some interesting background about what's happened with IronPython: http://devhawk.net/CategoryView,category,__clrtype__.aspx I'm still reading through it all, but note in particular the post from April 24, 2009: http://devhawk.net/2009/04/20/Introducing+Clrtype+Metaclasses.aspx My guess is

Re: [Ironruby-core] data binding in Silverlight 4

2010-09-27 Thread Brian Genisio
SIlverlight, unlike WPF, is incapable of binding to dynamic properties. Static properties, on the other hand are no problem. One way around this is to create a string indexer on your class (this[string index]) that returns the property by name. Then, in the XAML, you can bind using array (square

Re: [Ironruby-core] data binding in Silverlight 4

2010-09-27 Thread Charles Strahan
That's my understanding. Silverlight will only reflect over properties, as it does not use type descriptors - nor does it know how to determine a dynamic object's attributes. If you use attr_accessor, I believe that'll result in corresponding properties being added to the generated class. If all

[Ironruby-core] data binding in Silverlight 4

2010-09-27 Thread Christopher Bennage
I'm beginning to research this, but I don't want to reinvent the wheel if there is already a solution out there. My understanding of the problem is this: Data binding in Silverlight does not work because the system doesn't know how to handle dynamic objects. This is not the case in WPF because the