How to check if storyboard has completed
Last post 05-09-2008 4:13 PM by Samuray. 2 replies.
Sort Posts:
05-09-2008 3:22 AM
How to check if storyboard has completed

Hi everyone...I`m having a slight isssue in Silverlight 1.0.

The problem I have, is that I would like to check in my code behind js file if one animation has completed.

I used Completed="myFunction" animation, which calles myFunction where i have one global property that i set to true in this function, which indicates

that everything is "done", then  I`m triggering another storyboard, in "if" statement if this global property is true (by default is set to false), which

should work ... and it does...but it`s too fast, I mean it looks like, this global property is set to true too fast...

I don`t know if I`m making any sense...basically I would like to check in my js code if storyboard has completed, thats my goal.

 

Thank you for all your help.

Samuray

Joined on 05-08-2007
Posts 41
05-09-2008 8:42 AM
Re: How to check if storyboard has completed

I needed the same thing in an app I built using Silverlight 2 so the exact approach is different but hopefully this can give you an idea.  Basically I scoped a variable globally and default it to a value of "closed" (I used an enum but strings should work as well).  In the same event that causes the animation to start, I would change that variable to "running".  Then in the animation completed event, I change it back to "closed".  Then you can just check that variable to see if the animation is running or not. There was a little more to it than that but those are the basics.

Hope this helps,

John

John Stockton
Web Developer
blog

johnnystock

Joined on 01-10-2008
Akron, OH
Posts 59
05-09-2008 4:13 PM
Re: How to check if storyboard has completed

Ya I know what you mean, and ya i sort of did that...but still, events still get triggered a bit too soon (?)

P.S.

If i put one alert inthere, it works (dont know where the issue is)

Samuray

Joined on 05-08-2007
Posts 41