Module: IronNails::View::Extensions::EventSupport

Includes:
CommandSupport
Included in:
XamlProxy
Defined in:
lib/ironnails/view/xaml_proxy.rb

Instance Method Summary collapse

Methods included from CommandSupport

#execute_command

Methods included from ThreadingSupport

#on_new_thread, #on_ui_thread

Instance Method Details

#add_command(command) ⇒ Object

Adds the specified command to this view



88
89
90
91
92
93
94
95
96
# File 'lib/ironnails/view/xaml_proxy.rb', line 88

def add_command(command)
  command.view = self
  ele = (command.affinity || command.element).to_sym
  send(command.element.to_sym).send(command.trigger.to_sym) do
    on_ui_thread(ele) do
      execute_command command
    end if command.can_execute?
  end
end