[Ironruby-core] IronRuby with Silverlight question

Thibaut Barrère thibaut.barrere at gmail.com
Tue Apr 8 10:03:59 EDT 2008


I'm not sure ironruby-core is the right place for such a question, although
I don't know about any other forum. Is it adequate to post this here ?

My question is : I'm wondering if the following code can be simplified:

include System::Windows
include System::Windows::Controls

root = Application.Current.LoadRootVisual(UserControl.new(), "app.xaml")

root.find_name('HelloLabel').mouse_left_button_down do |sender,args|
    sender.text = "#{sender.text} - Hello from IronRuby !"

Specifically the root loading seems a bit overly complicated at first (I
could move this to a helper function though).

As well I'm wondering if it's somehow possible to have a root.hello_label
which would map to find_name("HelloLabel") - this could be implemented using
method_missing; maybe there is already an existing helper to do that ?

any advice will be most welcome!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080408/22257943/attachment.html 

More information about the Ironruby-core mailing list