Cobold
Cobold

Reputation: 2613

Disable event listener

Here's my xaml:

<Grid>
 <Grid Name="ButtonLayer"/>
 <Canvas Name="Overlay"/>
</Grid>

Here's my problem:

I have buttons in the ButtonLayer and a polyline in the Overlay Canvas. I wan't to disable all mouse events for the Overlay canvas so that the buttons in the ButtonLayer can receive mouse input. How to do it without moving the Overlay below the ButtonLayer (because then the Overlay is covered by the ButtonLayer)?

Upvotes: 0

Views: 114

Answers (1)

Rohit Vats
Rohit Vats

Reputation: 81243

Just set IsHitTestVisible=False on the Canvas. Events will pass through to your grid.

<Canvas Name="Overlay" IsHitTestVisible="False"/>

Upvotes: 2

Related Questions