Guest User

Untitled

a guest
May 21st, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. require "silverlight"
  2. require 'mint'
  3. require 'controls/clock'
  4.  
  5. class App < SilverlightApplication
  6. use_xaml
  7.  
  8. def initialize
  9. message.text = "Welcome to Ruby, Silverlight, and Mint!"
  10.  
  11. # We customized the trace panel, and this will show a message
  12. puts "testing the trace panel"
  13.  
  14. # Create a new Clock control
  15. clock = Clock.new
  16. clock.clock_name.text = "I can access a textblock as if clock were actually the xaml"
  17. clock_container.children.add clock
  18.  
  19. # Listen for a custom event
  20. clock.custom_event do |sender, event|
  21. puts "App: About to change clock name"
  22. clock.name = "Instead of directly accessing members of the xaml, I can call functions in my code-behind class"
  23. end
  24.  
  25. end
  26. end
  27.  
  28. $app = App.new
Add Comment
Please, Sign In to add comment