<Grid.Triggers> <EventTrigger SourceName="StartBtn" RoutedEvent="Button.Click"> <EventTrigger.Actions> <BeginStoryboard x:Name="MyStoryboard"> <Storyboard x:Name="Pulse_Animation_Story" RepeatBehavior="1x"> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="regularPolygon"> <EasingDoubleKeyFrame KeyTime="0" Value="0"/> <EasingDoubleKeyFrame KeyTime="0:0:4" Value="4320"/> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="regularPolygon1"> <EasingDoubleKeyFrame KeyTime="0" Value="90"/> <EasingDoubleKeyFrame KeyTime="0:0:4" Value="450"/> </DoubleAnimationUsingKeyFrames> </Storyboard> </BeginStoryboard> </EventTrigger.Actions> </EventTrigger>
<Grid.Style> <Style > <Style.Triggers> <DataTrigger Binding="{Binding Path=HasAnimations}" Value="True"> <DataTrigger.EnterActions> <!--REFERENCE STORY1 HERE--> <BeginStoryboard x:Name="MyStoryboard2"> <Storyboard x:Name="Pulse_Animation_Story2" RepeatBehavior="1x"> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="regularPolygon"> <EasingDoubleKeyFrame KeyTime="0" Value="0"/> <EasingDoubleKeyFrame KeyTime="0:0:4" Value="4320"/> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="regularPolygon1"> <EasingDoubleKeyFrame KeyTime="0" Value="90"/> <EasingDoubleKeyFrame KeyTime="0:0:4" Value="450"/> </DoubleAnimationUsingKeyFrames> </Storyboard> </BeginStoryboard> </DataTrigger.EnterActions> </DataTrigger> </Style.Triggers> </Style> </Grid.Style>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)