#740 – Set Background of Canvas to Transparent to Receive Touch Events
January 23, 2013 2 Comments
If you define one or more touch event handlers for a Canvas panel, without setting any other properties, you may not see any touch events for the canvas.
This happens because none of the controls inheriting from Panel will receive either touch or mouse events unless you specify a value for the panel’s Background property. So, to receive touch events for the Canvas, you can just set its Background property to Transparent.
<Canvas Name="canvMain" Background="Transparent" TouchDown="Canvas_TouchDown" TouchMove="Canvas_TouchMove" TouchUp="Canvas_TouchUp"> </Canvas>