IsHitTestVisible false を使用して、パネル内のコントロール (secondGrid) に対して MouseEvents を起動する方法はありますか。IsHitTestVisible を false にして、パネル内にボタンをロードしました。しかし、私は Button がその Mouse イベントを発生させたいと思っています。これを達成するために使用できる回避策はありますか? thirdGrid の IsHitTestVisible を true に設定すると、firstGrid でマウス イベントが発生しません。
<Grid Background="AliceBlue" x:Name="firstGrid" MouseLeftButtonUp="Grid_MouseLeftButtonUp"/>
<Grid Background="AliceBlue" x:Name="secondGrid" IsHitTestVisible="False"/>
<!--Event won't fire for this control since i'm setting IsHitTestVisible to false-->
<Grid x:Name="thirdGrid" IsHitTestVisible="False">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--Is there anyway to make this button to fire its events, even if i set its panles IsHitTestVisible to false-->
<Button Content="click" Width="150" Height="30"
MouseLeftButtonDown="Button_MouseLeftButtonDown"
IsHitTestVisible="True" />
</Grid>