我有一个在页面内其他位置工作的按钮。如果我将它添加到特定网格,它会显示但不可点击。这是我的全部标记:
<Grid Style="{StaticResource NogMasterPageGridStyle}">
<Grid.RowDefinitions>
<RowDefinition Height="140"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Page title -->
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="120"/>
<ColumnDefinition Width="300"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="15"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="20"/>
<RowDefinition Height="100"/>
<RowDefinition Height="20"/>
</Grid.RowDefinitions>
// THIS BUTTON SHOULD BE CLICKABLE, AND IS ELSEWHERE
<Button IsHitTestVisible="True" Grid.Column="0" Grid.Row="1" Canvas.ZIndex="9999" Content="Go Back" Style="{StaticResource NogButton}"
Click="Click_GoBack"/>
<StackPanel Grid.Column="1" Grid.Row="1" Grid.RowSpan="2" Orientation="Vertical" Margin="40,0,0,0">
<Image Style="{StaticResource NogLogoImage}" VerticalAlignment="Center"></Image>
<TextBlock Text="NOG" Style="{StaticResource NogPageTitle}"
IsHitTestVisible="false" TextWrapping="NoWrap" Margin="2,-35,0,0" HorizontalAlignment="Center"/>
</StackPanel>
</Grid>
什么可能导致按钮在此特定网格中无法点击?
编辑:我尝试禁用网格的样式,但是没有用。这是以下情况:
<Style x:Key="NogButton"
TargetType="Button">
<Setter Property="Foreground" Value="{StaticResource ColorBrushWhite}"/>
<Setter Property="Background" Value="{StaticResource ColorBrushGreen}"/>
<Setter Property="FontSize" Value="18"/>
</Style>
<ImageBrush x:Key="BackgroundNog"
ImageSource="ms-appx:///Assets/WhiteBackgroundAndPen.jpg"
Stretch="UniformToFill" />
<Style x:Key="NogMasterPageGridStyle"
BasedOn="{StaticResource LayoutRootStyle}"
TargetType="Panel">
<Setter Property="Background" Value="{StaticResource BackgroundNog}" />
</Style>