Hello smart people.
I'm just getting into C# and some unfamiliar piece of code so apologies if my question is not well asked.
The problem in short - I have a six by eight grid of System.Windows.Controls.Canvas
objects. The top left canvas does not receive mouse events while all the others do (I tried OnMouseMove
and OnMouseClick
events).
I went through the MSDN documentation Routed Events Overview. Suspecting that some child element may be handling the event, I used System.Windows.Media.VisualTreeHelper#GetChildrenCount()
to see if the object has any children. It doesn't have any. I also tried catching PreviewOnMouseMove
with no luck. I'm baffled as to who along the visual tree is eating the event. Can there be some (maybe transparent) control in front of my canvas that takes precedence in handling the event? As a Canvas object, can I know who's in front of me?
Thanks!