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