Intention: MouseEnter-triggered animation for app-wide each button.
Details:
- Animation should not happen if a button is pushed by spacebar.
- If animation is finished, button should be clicked.
- If button is clicked or pushed by user while animation is running, animation should stop at once (disappear).
- Xaml-only code, if possible, otherwise C#
Basic code for App.xaml:
<Style TargetType="{x:Type Button}">
<Style.Triggers>
<EventTrigger RoutedEvent="MouseEnter">
<EventTrigger.Actions>
<BeginStoryboard Name="buttonStoryboard">
<Storyboard>
<DoubleAnimation From="0" To="1" Duration="0:0:2.5" Storyboard.TargetProperty="(Opacity)" />
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Style.Triggers>
</Style>
Any help would be appreciated.
Aucun commentaire:
Enregistrer un commentaire