tags:

views:

184

answers:

2

Hi I have set Mouse Events on a canvas as follows

 MouseUp="CanvasUp" MouseDown="CanvasDown" MouseMove="CanvasMove"

But these are active only on the child elements like Images and Rectangles, but not on the empty space. Please tell me how to solve

Thanks

A: 

Set the background color. It defaults to null. Background="White" for instance.

Mark Synowiec
+1  A: 

A control with no background color set (explicitly or through styles etc) will default to having a background color of null - making it not hit-testable.

If you set the background to "Transparent" (or anything other than null ({x:Null})) then it will be able to pick up the mouse events

Rob Fonseca-Ensor
Great! I didn't know that.
Holli