天天看點

Silverlight中多個storyboard順序播放(代碼實作)

1、問題:在Blend中設計了多個storyboard動畫,現在有個要求,就是當第一個動畫播放完成後,第二個接着開始播放,程式代碼如何控制?

2、解決方案:

   處理第一個動畫在播放完成後的Completed事件,讓第二個動畫開始播放。

3、代碼實作:

public SYIT()

{

    // 為初始化變量所必需

    InitializeComponent();

    this.Storyboard1.Begin();

    this.Storyboard1.Completed += new EventHandler(Storyboard1_Completed);

}

void Storyboard1_Completed(object sender, EventArgs e)

    this.Storyboard2.Begin();

繼續閱讀