WPF-在xaml中完成另一个动画后开始动画 [英] WPF - Starting animation after another animation is finished in xaml

查看:283
本文介绍了WPF-在xaml中完成另一个动画后开始动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用WPF,并且有2个演示图板动画.我希望第二个动画在第一个动画结束后开始播放. 如何在xaml代码中做到这一点?

I am using WPF and I have 2 storyboard animations. I want the second animation to start after the first one is finished. How do I do that in the xaml code?

推荐答案

我不知道Xaml是否可行,如果您可以在后面使用一些代码,则可以执行以下操作:

I don't know if it is possible in Xaml, if you can use some code behind you can do something like this:

 <Storyboard x:Name="MyStoryboard" Completed="MyStoryboardCompleted" FillBehavior="Stop">

以及您后面的代码中

private void MyStoryboardCompleted(object sender, EventArgs e)
{
    var thing = this.FindResource("MyOtherStorboard");            
    var OtherSB = (Storyboard)thing;
    OtherSB.Begin();
}

这篇关于WPF-在xaml中完成另一个动画后开始动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆