我尝试了很多谷歌搜索但没有成功。我尝试使用Binding的DataTrigger,但我没有设法让它工作。
这就是我想要的:
<Border x:Name="PART_WindowCaptionMinimizeButton"
Width="15"
Height="15"
Background="#E1E1E1"
Margin="0 0 0 4">
<Path x:Name="minimizePath"
Stroke="#3090C7"
Data="m 3,11.5 8,0 0,0.5 -8,0 z" />
<Border.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<!-- I WANT PATH (minimizepath) TO GET GLOW EFFECT -->
</Trigger>
</Border.Triggers>
</Border>
这是发光效果代码:
<Setter Property="Effect">
<Setter.Value>
<DropShadowEffect ShadowDepth="0"
Color="#3090C7"
Opacity="0"
BlurRadius="7"/>
</Setter.Value>
</Setter>
答案 0 :(得分:2)
Border.Triggers只启用EventTrigger,然后不启用IsMouseOver而只启用MouseEnter。在这里,试试这个
<Border x:Name="PART_WindowCaptionMinimizeButton"
Width="45"
Height="45"
Background="#E1E1E1"
Margin="0 0 0 4">
<Path x:Name="minimizePath"
Stroke="#3090C7"
Data="m 3,11.5 8,0 0,0.5 -8,0 z" >
<Path.Style>
<Style TargetType="Path">
<Setter Property="Effect" Value="{x:Null}"/>
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=PART_WindowCaptionMinimizeButton, Path=IsMouseOver}" Value="True">
<Setter Property="Effect">
<Setter.Value>
<DropShadowEffect ShadowDepth="0"
Color="CadetBlue"
Opacity="1"
BlurRadius="7"/>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</Path.Style>
</Path>
</Border>