问题描述:

How would I check the status of a storyboard?

Example:

if (storyboard.Completed += true) // ???

{

}

(This code does not work, for obvious reasons.)

网友答案:

Just hook the Completed event and when your code runs in there, the storyboard will have been completed. See: http://msdn.microsoft.com/en-us/library/system.windows.media.animation.timeline.completed(VS.95).aspx#Y565

网友答案:

how about creating a boolean variable (e.g. IsCompleted) and set it to true in the Completed callback?

网友答案:

if(storyboard.GetCurrentState() == ClockState.Active)

{

// do something

}

网友答案:

This doesn't work.

            Storyboard storyBoardPulse = this.FindResource("StoryboardMainIconPulse") as Storyboard;
            Storyboard.SetTarget(storyBoardPulse, this.imageIcon);

            if (storyBoardPulse.GetCurrentState() != ClockState.Active)
            {
                storyBoardPulse.Begin();
            }
相关阅读:
Top