[Ironruby-core] IronRuby with Silverlight question

John Lam (DLR) jflam at microsoft.com
Tue Apr 8 10:12:45 EDT 2008


Have you looked at silverlight.rb from our http://dynamicsilverlight.net samples? If it's not there, look at the Part 3 sample from my intro to Ruby + Silverlight blog post:

http://www.iunknown.com/2008/03/dynamic-silve-2.html

Thanks,
-John


> -----Original Message-----
> From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-
> bounces at rubyforge.org] On Behalf Of Thibaut Barrère
> Sent: Tuesday, April 08, 2008 7:04 AM
> To: ironruby-core at rubyforge.org
> Subject: [Ironruby-core] IronRuby with Silverlight question
>
> Hi
>
> 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 !"
> end
> =======================
>
> 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!
>
> cheers
>
> Thibaut


More information about the Ironruby-core mailing list