Demond
Topic Author
Posts: 20
Joined: 06 Feb 2023, 23:32

In Storyboard, only the last one of several ColorAnimations is executed

18 Aug 2024, 11:51

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.
<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>
 
User avatar
jsantos
Site Admin
Posts: 4823
Joined: 20 Jan 2012, 17:18
Contact:

Re: In Storyboard, only the last one of several ColorAnimations is executed

19 Aug 2024, 12:45

This is a bug. Please file a ticket. Thank you!
 
Demond
Topic Author
Posts: 20
Joined: 06 Feb 2023, 23:32

Re: In Storyboard, only the last one of several ColorAnimations is executed

19 Aug 2024, 13:11

This is a bug. Please file a ticket. Thank you!
I created a ticket #3647 )
 
User avatar
jsantos
Site Admin
Posts: 4823
Joined: 20 Jan 2012, 17:18
Contact:

Re: In Storyboard, only the last one of several ColorAnimations is executed

21 Aug 2024, 12:50

Thank you!
 
Demond
Topic Author
Posts: 20
Joined: 06 Feb 2023, 23:32

Re: In Storyboard, only the last one of several ColorAnimations is executed

22 Feb 2025, 19:17

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?
 
User avatar
sfernandez
Site Admin
Posts: 3364
Joined: 22 Dec 2011, 19:20

Re: In Storyboard, only the last one of several ColorAnimations is executed

25 Feb 2025, 18:51

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.

Who is online

Users browsing this forum: Google [Bot] and 5 guests