<Window.Resources>
<Storyboard x:Key="ButtonEffect_01" AutoReverse="True" RepeatBehavior="Forever">
<ColorAnimationUsingKeyFrames
Storyboard.TargetProperty="(UIElement.Effect).(DropShadowEffect.Color)"
Storyboard.TargetName="btnAdd">
<EasingColorKeyFrame KeyTime="0" Value="Black"/>
<EasingColorKeyFrame KeyTime="0:0:0.4" Value="#FFF3FF00"/>
</ColorAnimationUsingKeyFrames>
</Storyboard>
</Window.Resources>
<Button x:Name="btnAdd" Content="Add" Width="69" Height="27">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseEnter">
<ei:ControlStoryboardAction Storyboard="{StaticResource ButtonEffect_01}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
我有3個更多按鈕btnDelete,btnUpdate,btnBack我可以對所有這些按鈕使用相同的Storyboard嗎?任何綁定方法?我們可以爲WPF XAML中的多個按鈕創建單個Storyboard嗎?
,故事情節必須在同一時間每個按鈕運行,因此我不認爲你可以做到這一點.. – Pragmateek 2014-09-06 16:52:33
是的,使用故事板的單個實例的成本是,在時間只有一個動畫。但如果範圍在鼠標上投下陰影,我認爲他有一個動畫在運行。 – Frix33 2014-09-06 17:06:06
只有OP知道:)但是沒有'MouseLeave'難以確定... – Pragmateek 2014-09-06 17:10:24