Skip to main content

Microsoft Silverlight

Answered Question check if animation played??RSS Feed

(0)

cdubone
cdubone

Member

Member

187 points

224 Posts

check if animation played??

I'm wondering if there is a way to determine if an animation has just played. I'm making an accordion menu and I need to start the 'menu close' animation when the next button is pressed. In order to do this I have to determine which menu was clicked last. Thoughts?

Chris Williams

y_makram
y_makram

Contributor

Contributor

6172 points

1,233 Posts

Re: check if animation played??

There is no API specific for knowing if an animation has been played. So you need to use some form of variable to hold the last animated object and maintain it whenever your animation starts or completes. 

Thanks
Yasser Makram
http://www.silverlightrecipes.com
_____
Dont forget to click "Mark as Answer" on the post that helped you. If your question has not been answered, please post a followup question.

BenHayat
BenHayat

Participant

Participant

1033 points

600 Posts

Re: check if animation played??

 

cdubone:

I'm wondering if there is a way to determine if an animation has just played. I'm making an accordion menu and I need to start the 'menu close' animation when the next button is pressed. In order to do this I have to determine which menu was clicked last. Thoughts?

I had asked the team to give us a "Completed" event many months ago and they said they might. So, let's ask them again.

My vote for a "Completed" event!

___________
Best Regards;
..Ben

Silverlight & WPF Insider
Please visit www.MicroIntelligence.Com For our services!

cdubone
cdubone

Member

Member

187 points

224 Posts

Re: check if animation played??

Thanks for getting back to me Yasser and Ben!

I'm pretty surprised there isn't a 'Completed' event, that sure would be handy. I'm all for it. In the mean time I'll give the variable approach a try.

Chris Williams

y_makram
y_makram

Contributor

Contributor

6172 points

1,233 Posts

Re: check if animation played??

 There is a completed event for the Storyboard, but not for a single animation.

Thanks
Yasser Makram
http://www.silverlightrecipes.com
_____
Dont forget to click "Mark as Answer" on the post that helped you. If your question has not been answered, please post a followup question.

cdubone
cdubone

Member

Member

187 points

224 Posts

Re: check if animation played??

 

I guess what I mean is 'has played' and not 'on completed'. For example if Storyboard1 'is at the end of its animation' then start Storyboard2 else start Storyboard3. Is something like this possible? Or am I still better off trying the variable approach?

 

Chris Williams

y_makram
y_makram

Contributor

Contributor

6172 points

1,233 Posts

Answered Question

Re: check if animation played??

You need to use variables to track the running Storyboards.

Thanks
Yasser Makram
http://www.silverlightrecipes.com
_____
Dont forget to click "Mark as Answer" on the post that helped you. If your question has not been answered, please post a followup question.

cdubone
cdubone

Member

Member

187 points

224 Posts

Re: check if animation played??

 Cool, thanks!

Chris Williams
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities