wpfxamldoubleanimation

How to set time between single Animation repeats in WPF?


I have a DoubleAnimation for a waiting control and it repeats forever. But I want to set time between every repeats. How can I do that?

My animation is:

<DoubleAnimation Storyboard.TargetName="rect1"
                 Storyboard.TargetProperty="Height"
                 To="10" BeginTime="0:0:0" Duration="0:0:0.3"
                 AutoReverse="True" RepeatBehavior="Forever"/>

Solution

  • Set a Duration on the enclosing Storyboard:

    <Storyboard AutoReverse="True" RepeatBehavior="Forever" Duration="0:0:1">
        <DoubleAnimation Storyboard.TargetName="rect1"
                         Storyboard.TargetProperty="Height"
                         To="10" Duration="0:0:0.3"/>
    </Storyboard>