Silverlight:Storyboard的已完成事件处理程序延迟

问题描述 投票:3回答:1

在视觉动画结束后,storyBoard_Completed事件会在大约半秒的时间内被调用。

很高兴有更多的眼睛看看我的Storyboard XAML:

    <Storyboard x:Key="blaAnimation" Completed="storyBoard_Completed">
        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="bla1" Storyboard.TargetProperty="Offset" Completed="bla_Completed">
            <DiscreteDoubleKeyFrame KeyTime="0:0:0" x:Name="bla1StartKeyFrame"/>

            <EasingDoubleKeyFrame Value="-10.2" KeyTime="0:0:1">
                <EasingDoubleKeyFrame.EasingFunction>
                    <PowerEase EasingMode="EaseIn"/>
                </EasingDoubleKeyFrame.EasingFunction>
            </EasingDoubleKeyFrame>

            <EasingDoubleKeyFrame KeyTime="0:0:2" Value="-20" x:Name="bla1Animation">
                <EasingDoubleKeyFrame.EasingFunction>
                    <ElasticEase EasingMode="EaseOut" Oscillations="5" Springiness="20"/>
                </EasingDoubleKeyFrame.EasingFunction>
            </EasingDoubleKeyFrame>
        </DoubleAnimationUsingKeyFrames>

        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="bla2" Storyboard.TargetProperty="Offset" BeginTime="0:0:0.1" Completed="bla2_Completed">
            <DiscreteDoubleKeyFrame Value="0" KeyTime="0:0:0.1" x:Name="bla2StartKeyFrame"/>

            <EasingDoubleKeyFrame Value="-10.2" KeyTime="0:0:1.1">
                <EasingDoubleKeyFrame.EasingFunction>
                    <PowerEase EasingMode="EaseIn"/>
                </EasingDoubleKeyFrame.EasingFunction>
            </EasingDoubleKeyFrame>

            <EasingDoubleKeyFrame KeyTime="0:0:2.1" Value="-20" x:Name="bla2Animation">
                <EasingDoubleKeyFrame.EasingFunction>
                    <ElasticEase EasingMode="EaseOut" Oscillations="5" Springiness="20"/>
                </EasingDoubleKeyFrame.EasingFunction>
            </EasingDoubleKeyFrame>
        </DoubleAnimationUsingKeyFrames>

        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="bla3" Storyboard.TargetProperty="Offset" BeginTime="0:0:0.18" Completed="bla3_Completed">
            <DiscreteDoubleKeyFrame Value="0" KeyTime="0:0:0.2" x:Name="bla3StartKeyFrame"/>

            <EasingDoubleKeyFrame Value="-10.2" KeyTime="0:0:1.2">
                <EasingDoubleKeyFrame.EasingFunction>
                    <PowerEase EasingMode="EaseIn"/>
                </EasingDoubleKeyFrame.EasingFunction>
            </EasingDoubleKeyFrame>

            <EasingDoubleKeyFrame KeyTime="0:0:2.2" Value="-20" x:Name="bla3Animation">
                <EasingDoubleKeyFrame.EasingFunction>
                    <ElasticEase EasingMode="EaseOut" Oscillations="5" Springiness="20"/>
                </EasingDoubleKeyFrame.EasingFunction>
            </EasingDoubleKeyFrame>
        </DoubleAnimationUsingKeyFrames>


    </Storyboard>

在此先感谢, - 兰。

wpf silverlight animation silverlight-4.0 storyboard
1个回答
1
投票

如果有疑问 - 混合它

继续评论追踪(上图),最终结果是“如果您有权访问它(或者可以负担得起),请始终使用Expression Blend创建动画故事板”

混合是学习动画的最佳方式,它可以很容易地变得非常复杂。 Blend还会自动为您自动优化动画。

如你所知,除了XAML之外,在VS 2010中根本不支持创作动画,这很容易出错。 在你的头脑中可视化多个动画也很困难,只有文字可以通过:)

© www.soinside.com 2019 - 2024. All rights reserved.