Skip to content

@Ball /bind_example.rb
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Binding Example
require 'xamltools.rb'
require 'PresentationFramework'
class ViewModel
attr :greeting, true
def initialize(greet)
@greeting = greet
end
end
view = XamlTools::Xaml.window(:Width => 450, :SizeToContent => :Height) do |w|
w.TextBlock(:FontSize => 48, :HorizontalAlignment=> :Center, :Text => "{Binding Path=greeting}")
end
view.data_context = ViewModel.new( "I'm Bound!" )
System::Windows::Application.new.run(view)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.