我想让按钮内的文本在变为 KeyboardFocused 时发光。
我无法做到这一点。这是我的xml:
<Style x:Key="BorderlessSymbolButtonStyle" TargetType="{x:Type Button}" >
<Setter Property="FocusVisualStyle" Value="{DynamicResource MetroButtonFocusVisual}"/>
<Setter Property="BitmapEffect">
<Setter.Value>
<OuterGlowBitmapEffect GlowColor="White" Opacity="0" GlowSize="3" Noise=".1"/>
</Setter.Value>
</Setter>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Grid x:Name="Grid">
<Border x:Name="Border" Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}"/>
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
x:Name="Content"
Margin="{TemplateBinding Padding}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
RecognizesAccessKey="True"
BitmapEffect="{TemplateBinding BitmapEffect}" >
</ContentPresenter>
</Grid>
<ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsPressed" Value="true"/>
<Condition Property="IsEnabled" Value="true"/>
</MultiTrigger.Conditions>
<Setter Property="Foreground" Value="{DynamicResource GlenairMediumBlue}"/>
</MultiTrigger>
<Trigger Property="IsKeyboardFocused" Value="true">
<!--<Setter Property="BorderBrush" Value="{DynamicResource DefaultedBorderBrush}" TargetName="Border"/>-->
<!--<Setter Property="Effect" TargetName="Border" Value="{DynamicResource BorderDropShadow}"/>-->
<Setter Property="BitmapEffect" >
<Setter.Value>
<OuterGlowBitmapEffect GlowColor="White" Opacity=".4" GlowSize="3" Noise=".1"/>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="Gray"/>
</Trigger>
<!--<Trigger Property="IsEnabled" Value="true">
<Setter Property="Foreground" Value="White"/>
</Trigger>-->
<!--<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" Value="{DynamicResource MouseOverBrush}" TargetName="Border"/>
</Trigger>-->
<!--<Trigger Property="IsPressed" Value="true">
<Setter Property="Foreground" Value="{DynamicResource GlenairLighterOpaqueBlueSolidColorBrush}" />
</Trigger>-->
<!--<Trigger Property="IsEnabled" Value="true"/>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border"/>
<Setter Property="BorderBrush" Value="{DynamicResource DisabledBorderBrush}" TargetName="Border"/>
<Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
</Trigger>-->
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
非常感谢!无法在 google/SO 上找到我的问题的解决方案。