Silverlight Events
onLoad: Silverlight.createDelegate(scene, scene.handleLoad)
}
Silverlight.createDelegate = function(instance, method) {
return function() {
return method.apply(instance, arguments);
}
<Canvas MouseLeftButtonDown="JavaScript:Play" x:N..
function Play(sender, eventArgs)
{...
{
this.control = control;
rootElement.addEventListener("keyDown", Silverlight.createDelegate(this, this.handleKeyDown));
},
handleKeyDown: function(sender, keyEventArgs)
{
alert(keyEventArgs.key);
}
handleMouseUp: function(sender, eventArgs)
{
host = sender.getHost();
host.content.fullscreen = !host.content.fullscreen;
}