I have a canvas control in my WPF project:
<Canvas x:Name="mainCanvas" Margin="0"
MouseMove="mainCanvas_MouseMove"
MouseLeftButtonDown="mainCanvas_MouseLeftButtonDown"/>
In this canvas control, there are some other Canvas controls as children.
The problem is that when I click on these child canvas controls, the mainCanvas_MouseLeftButtonDown callback is not called. I don't bind anything to the mouse down event of these child canvases.
The mainCanvas_MouseMove callback seems to be working fine though, it is called even when I mouse over the child canvases.
I tried preview mouse down events with no luck.
How can I solve this problem?
<Canvas Background="Transparent">to get mouse events and set<ScrollViewer Focusable="False">if the canvas is inside a scroll viewer - r2d2