无论如何使用 IsHitTestVisible 为面板(thirdGrid)内的控件触发 MouseEvents 为假。我已经在面板内加载了 IsHitTestVisible 为 false 的按钮。但我希望 Button 触发其鼠标事件。我可以使用任何解决方法来实现这一目标吗?如果我将 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>