Class: WpfApplication
- Inherits:
-
System::Windows::Application
- Object
- System::Windows::Application
- WpfApplication
- Includes:
- IronNails::Logging::ClassLogger
- Defined in:
- lib/ironnails/wpf_application.rb
Instance Attribute Summary collapse
-
#nails_engine ⇒ Object
readonly
Returns the value of attribute nails_engine.
Instance Method Summary collapse
- #has_main_window? ⇒ Boolean
-
#initialize(&b) ⇒ WpfApplication
constructor
A new instance of WpfApplication.
- #load_skin(name = :default) ⇒ Object
- #set_skin(name) ⇒ Object
Methods included from IronNails::Logging::ClassLogger
Constructor Details
#initialize(&b) ⇒ WpfApplication
Returns a new instance of WpfApplication.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/ironnails/wpf_application.rb', line 7 def initialize(&b) logger.debug "Starting application", IRONNAILS_FRAMEWORKNAME @nails_engine = NailsEngine.new controller = instance_eval &b nails_engine.register_controller controller nails_engine.show_initial_window controller do |view_instance| @main_window = view_instance run view_instance end end |
Instance Attribute Details
#nails_engine ⇒ Object (readonly)
Returns the value of attribute nails_engine.
5 6 7 |
# File 'lib/ironnails/wpf_application.rb', line 5 def nails_engine @nails_engine end |
Instance Method Details
#has_main_window? ⇒ Boolean
18 19 20 |
# File 'lib/ironnails/wpf_application.rb', line 18 def has_main_window? @main_window.nil? end |
#load_skin(name = :default) ⇒ Object
26 27 28 |
# File 'lib/ironnails/wpf_application.rb', line 26 def load_skin(name=:default) XamlReader.load_from_path skins_path("#{name}.xaml") end |
#set_skin(name) ⇒ Object
22 23 24 |
# File 'lib/ironnails/wpf_application.rb', line 22 def set_skin(name) self.resources.merged_dictionaries.add load_skin(name) end |