Demond
Topic Author
Posts: 14
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: 4070
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: 14
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: 4070
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!

Who is online

Users browsing this forum: Bing [Bot] and 2 guests