1
如何在WPF
生成可重复使用的Button
Style
使得Button
的Content
(无论是)得到发光效果时,鼠标悬停。Glow效果
这样的预期效果(左=正常,右=鼠标)
我已经定义了一个Button
但Style
我需要什么样的Triggers
实现呢?
<Style x:Key="GlowEffectButton" TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
//... ??
</ControlTemplate>
</Setter.Value>
</Setter>
我可能会使用一个Image
或Path
作为Button
Content
。
<Button Style="{StaticResource GlowEffectButton}">
<Button.Content>
//IMAGE OR PATH as Content
</Button.Content>
</Button/>
有没有办法来发光效果设置为一个广义Button
Style
?如果我仅将Button
内容限制为仅使用XAML
矢量/ Path
,是否可以制作?
你可能会玩弄'DropShadowEffect'。更多帮助[here](http://stackoverflow.com/questions/18399401/glow-effect-on-mouseenter-wpf) – lokusking