I have a DesignerCanvas (derived from canvas) that I can add UIElements to, then drag\drop\move\group and move them around.
On the toolbar I have a button that is bound to a group command.
<Button Margin="0,3,0,3" Padding="5" HorizontalContentAlignment="Left"
Command="{x:Static s:DesignerCanvas.Group}"
CommandTarget="{Binding ElementName=DesignerCanvas}">
The problem that I have is that I can have a control that also contains a DesignerCanvas. So there are nested canvas's, and I want the GroupCommand on the toolbar to apply to the canvas that is in focus. In the above binding it is binding only to the root canvas.
I suppose I could track the current canvas and expose it in the viewmodel for the binding, but I'd prefer to avoid tracking the activecanvas.
Any suggestions for a creative binding here?
Thanks, jeff