【问题标题】:RepeatBehavior doesn't work in Expression Blend?RepeatBehavior 在 Expression Blend 中不起作用?
【发布时间】:2013-09-04 10:24:14
【问题描述】:

这只是我还是什么? RepeatBehavior 似乎不适用于 Expression Blend 4 中的动画。我有以下动画:

<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" 
    Storyboard.TargetName="WaitDoc" RepeatBehavior="0:0:2">
                <EasingDoubleKeyFrame KeyTime="0:0:1.0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:1.1" Value="180"/>
                <EasingDoubleKeyFrame KeyTime="0:0:1.2" Value="360"/>
</DoubleAnimationUsingKeyFrames>

我希望此动画运行 2 秒,但当我单击 对象和时间轴 窗格中的播放按钮时,它只运行一次。我也尝试过像 5x 这样的值,得到了相同的行为。

我不想运行整个项目来测试每一分钟的变化。播放按钮应该按定义播放。我在这里遗漏了什么吗?

编辑:此外,我刚刚发现 Blend 也不尊重 BeginTime 属性。

【问题讨论】:

    标签: wpf xaml animation expression-blend


    【解决方案1】:

    试试这个:

      <DoubleAnimationUsingKeyFrames   
                      Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children) [2].(RotateTransform.Angle)" 
    Storyboard.TargetName="WaitDoc" Duration="0:0:2" RepeatBehavior="Forever">
                <EasingDoubleKeyFrame KeyTime="0:0:1.0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:1.1" Value="180"/>
                <EasingDoubleKeyFrame KeyTime="0:0:1.2" Value="360"/>
      </DoubleAnimationUsingKeyFrames>
    

    【讨论】:

    • 相同的行为。另外,我刚刚发现 Blend 也不尊重 BeginTime 属性。
    • 你试过“永远”吗? ,因为在您的代码中您编写了 RepeatBehavior="0:0:2" ,对吗?
    • 是的。我实际上是从您上面的代码中复制/粘贴了这两个属性(DurationRepeatBehavior)。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多