Hi,
I am creating an animation using story board and entire thing is inside a ItemsControl,when i start the application the animation starts, but i want an ability to stop the animation as soon as we receive a value from the database. How do i get hold of a particular story board inside an ItemsControl template so that i can stop it in my code behind. Or is there a property that i can data bind and use in code behind.
Currently my code look like this
<StackPanel
x:Name="spStart"
Margin="0,10,5,0">
<Image x:Name="Round" Source="Images/Start.png"
Height="35"
Stretch="Uniform"
ToolTipService.ToolTip="Start"
RenderTransformOrigin="0.5,0.5">
<Image.RenderTransform>
<TransformGroup>
<RotateTransform/>
</TransformGroup>
</Image.RenderTransform>
<Image.Triggers>
<EventTrigger RoutedEvent="Grid.Loaded">
<BeginStoryboard>
<Storyboard x:Name="RotatingStory" Completed="myStoryboard_Completed"
x:Uid="{Binding FileReceived}">
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
Storyboard.TargetName="Round"
Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(RotateTransform.Angle)">
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
<SplineDoubleKeyFrame KeyTime="00:00:03" Value="360"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Image.Triggers>
</Image>
</StackPanel>