MouseLeftButtonDown event in StackPanel and Grid don’t fire every time

Recently I have been playing with silverlight and I came into a situation where MouseLeftButtonDown event is not triggered every time.It is only triggered when I click on child control inside container.

One way to fix this is to set background color of container to something.In my example I set my background color of grid control to transparent.

<Grid Height="100" Width="Auto" MouseLeftButtonDown="Grid_MouseLeftButtonDown" Background="Transparent">

Now if you click anywhere inside grid control MouseLeftButtonDown event is triggered.

Comments are closed.