There are two common idioms for creating events (and wiring up their handlers) for XAML objects.
One is to place the name of the event and the name of its handler in the XAML itself
<Canvas Canvas.Top="180" Canvas.Left="200" MouseLeftButtonDown="onMouseDown" MouseLeftButtonUp="onMouseUp" MouseMove="onMouseMove">
The other is to create a link between a reference to the XAML object and its handler in the code-behind; typically in the handler for page load
this.button.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.handleMouseDown)); this.button.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.handleMouseUp)); this.button.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.handleMouseLeave));
The CreateDelegate method ensures that the event is correctly routed. This method is created for you by the Silverlight 1.0 template in Visual Studio.
Silverlight.createDelegate = function(instance, method) { return function() { return method.apply(instance, arguments); } }