if (!window.ButtonSample)
	window.ButtonSample = {};

ButtonSample.Scene = function() 
{
}

ButtonSample.Scene.prototype =
{
	handleLoad: function(control, userContext, rootElement) 
	{
		this.control = control;
		
		// Create the button wrapper classes. 
		// Have to pass in the parameters to set on the visuals since the visuals have not been created yet.
		this.button1 = new Button(rootElement, 100, 100);
		this.button2 = new Button(rootElement, 200, 200);
		
		// Hook up event handlers for the button click events.
		// This is just a property, not a list of events like C# has.
		this.button1.clickHandler = Sys.Silverlight.createDelegate(this, this.handleButton1Click);
		this.button2.clickHandler = Sys.Silverlight.createDelegate(this, this.handleButton2Click);
		
		// Create a bunch more for good measure.
		for (var i = 0; i < 10; ++i) {
			new Button(rootElement, Math.random() * 300, Math.random() * 300).clickHandler = function() { alert(i); };
		}
	},
	
	handleButton1Click: function() {
		alert("One!");
	},
	
	handleButton2Click: function() {
		alert("Two!");
	}
}