In Storyboard, only the last one of several ColorAnimations is executed
Hi!
I wrote a small example of complex animation by color for a regular rectangle. And it seems that only the last animation is played (i.e. after BeginTime="0:0:50"). I checked this behavior in WPF and all animations are performed without problems.
I wrote a small example of complex animation by color for a regular rectangle. And it seems that only the last animation is played (i.e. after BeginTime="0:0:50"). I checked this behavior in WPF and all animations are performed without problems.
Code: Select all
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Rectangle x:Name="Rect" Height="100" Width="100" Fill="LightGreen" VerticalAlignment="Center" HorizontalAlignment="Center">
<Rectangle.Triggers>
<EventTrigger RoutedEvent="Loaded">
<BeginStoryboard>
<Storyboard TargetName="Rect" TargetProperty="(Rectangle.Fill).(SolidColorBrush.Color)">
<ColorAnimation
BeginTime="0:0:0"
Duration="0:0:1" From="LightGreen" To="Red"
RepeatBehavior="10x"
AutoReverse="True" />
<ColorAnimation
BeginTime="0:0:10"
Duration="0:0:0.8" From="LightGreen" To="Red"
RepeatBehavior="12.5x"
AutoReverse="True" />
<ColorAnimation
BeginTime="0:0:20"
Duration="0:0:0.4" From="LightGreen" To="Red"
RepeatBehavior="25x"
AutoReverse="True" />
<ColorAnimation
BeginTime="0:0:30"
Duration="0:0:0.2" From="LightGreen" To="Red"
RepeatBehavior="50x"
AutoReverse="True" />
<ColorAnimation
BeginTime="0:0:40"
Duration="0:0:0.1" From="LightGreen" To="Red"
RepeatBehavior="100x"
AutoReverse="True" />
<ColorAnimation
BeginTime="0:0:50"
Duration="0:0:0.05" From="LightGreen" To="Red"
RepeatBehavior="200x"
AutoReverse="True" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Rectangle.Triggers>
</Rectangle>
</Grid>
Re: In Storyboard, only the last one of several ColorAnimations is executed
This is a bug. Please file a ticket. Thank you!
Re: In Storyboard, only the last one of several ColorAnimations is executed
I created a ticket #3647 )This is a bug. Please file a ticket. Thank you!
Re: In Storyboard, only the last one of several ColorAnimations is executed
I would like to know when this problem will be fixed? Judging by the previous bug tickets, this problem has been around for 10 years since the first bug ticket about this problem was created #694. This solution is vital for creating good object animations. I have several animations that need to be played in sequence, but the last animation is currently running. Is there a temporary workaround at the moment?
-
-
sfernandez
Site Admin
- Posts: 3364
- Joined:
Re: In Storyboard, only the last one of several ColorAnimations is executed
Using KeyFrame animations has been enough for the majority of our users, so that issue was never a priority. Instead of launching different ColorAnimations with different BeginTime, you can set up a single ColorAnimationUsingKeyFrames with all the different KeyFrames you need.
If you elaborate a bit on what you want to achieve we can help you define an equivalent storyboard using KeyFrame animations.
If you elaborate a bit on what you want to achieve we can help you define an equivalent storyboard using KeyFrame animations.
Who is online
Users browsing this forum: Google [Bot] and 5 guests