Drag/drop controls onto child Canvas without parent Canvas being notified
<p>I'm trying to create a visual "designer" that will allow users to drag controls from a toolbox onto a design canvas. The excellent tutorial <a href="http://www.codeproject.com/Articles/22952/WPF-Diagram-Designer-Part" rel="nofollow noreferrer">here</a> has helped me get a basic system up and going - I can drag controls from the toolbox, select and resize them etc. Amongst other things,the code uses a modified <code>Canvas</code> control, overriding the <code>OnDrop</code> method. </p>

<p>However, I'd like to give the user the option of defining "panels" within the design: effectively smaller Canvas's containing the toolbox controls - as an example:</p>

<p><a href="https://i.stack.imgur.com/GVYwJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GVYwJ.png" alt="enter image description here"></a></p>

<p>So when the user drags the button onto Canvas_1, <code>OnDrop</code> fires and all is good. However, if the user creates Canvas_2, and then drags the button onto Canvas_2 - itself a child control of Canvas_1 - the parent <code>OnDrop</code> still fires and the button is added to Canvas_1. </p>

<p>I've tried setting the ZIndex of Canvas_2 to greater than Canvas_1, to no avail - the parent Canvas always gets the event. How can I ensure that Canvas_2 gets the <code>OnDrop</code> events for controls landing on it? Is there a different approach I should be using?</p>