John Sourcer
John Sourcer

Reputation: 451

Manipulations in a user control on a nested canvas

I'm trying to capture manipulations on a canvas in a user control structured as follows:

<UserControl IsManipulationEnabled="true">    
    <Canvas x:Name="CanvasContainer" Width="1500" Height="780">
        <ZoomableCanvas ManipulationStarting="ShareSwarmCanvas_OnManipulationStarting" ApplyTransform="false" x:Name="ShareSwarmCanvas" Width="1500" Height="780" MinWidth="1500" MinHeight="780" />
    </Canvas>
</UserControl>

If I add a 'ManipulationStarting' event to the control and handled it, it captures fine and passes the UserControl as the sender. However I can't capture on the nested canvas even if I set 'IsManipulationEnabled=true' on it. I understand that the routed events bubble down until handled and I am handling it. It isn't a stacking issue?

Upvotes: 0

Views: 203

Answers (1)

John Sourcer
John Sourcer

Reputation: 451

Simple in the end as always. Add a background property to the UIElement.

Upvotes: 1

Related Questions