I had a WPF app which drew some geometry on a Canvas. Today I needed to add a Region Of Interest (ROI) rectangle which I initially did using the same canvas just for debugging. The Mouse Event handlers are used to draw the rectangle . . .
<Canvas Name="cnv" Canvas.Top="0" Canvas.Left="0" Margin="10,21,315,251"
MouseDown="cnvMouseDown" MouseUp="cnvMouseUp" MouseMove="cnvMouseMove" />
... That worked OK so I decided to move the ROI rectangle code to a separate Canvas overlaying the original one so I could delete and redraw the rectangle without disturbing the other geometry on the first Canvas. ... so now I have this . . .
<Canvas Name="cnv" Canvas.Top="0" Canvas.Left="0" Margin="10,21,315,251"
MouseDown="cnvMouseDown" MouseUp="cnvMouseUp" MouseMove="cnvMouseMove" />
<Canvas Name="ROIcnv" Canvas.Top="0" Canvas.Left="0" Margin="10,21,315,251"
MouseDown="ROIcnvMouseDown" MouseUp="ROIcnvMouseUp" MouseMove="ROIcnvMouseMove"/>
... but now NONE of the mouse event handlers for either Canvas get triggered when I click or move the mouse. Note that the only ones I care about are the ones on the second canvas, i.e., the ROIcnv... ones.