Silverlight Canvas not support KeyDown?
I have it:
<Canvas x:Name="LayoutRoot" KeyDown="LayoutRoot_KeyDown"> </Canvas> In the new Ag 3 application in VS2008. I simply changed the default <Grid /> to <Canvas /> and added the KeyDown handler that appears in the MessageBox.
But no matter how hard I try, the KeyDown simply never fires.
Is it just that <Canvas /> does not support KeyDown , or am I doing something wrong?
Since your Canvas is a "LayoutRoot", you can use UserControl instead.
Put the IsTabStop="true" property in the UserControl . In the Loaded event this.Focus() . Attach the KeyDown handler to UserControl instead of Canvas .
As long as the plugin itself has focus (which you can provide with a little Javascript), you should get key events.