I have a label in Code below:
<Window.Triggers>
<EventTrigger RoutedEvent="Loaded">
<BeginStoryboard>
<Storyboard FillBehavior="Stop" >
<DoubleAnimation RepeatBehavior="Forever"
Storyboard.TargetName="Transform"
Storyboard.TargetProperty="X"
From="220" To="-1300" Duration="0:0:15" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Window.Triggers>
<StackPanel >
<Label Content="Hello! your Welcome" HorizontalAlignment="Right" FontSize="11">
<Label.RenderTransform>
<TranslateTransform x:Name="Transform" X="0" Y="0"/>
</Label.RenderTransform>
</Label>
</StackPanel>
the label moves into my window but I want to Change content
of label when the priod is started again.
if you suggest a code with List<> insted of label will be better.
You can run the animation once, then on the completed event change the content of the label, and then continue to run the animation.
Your code will be more compact, if you move the animation to the resources:
XAML:
Code Behind: