Jason94
Jason94

Reputation: 13620

How can I stop something happening again before it is finished?

I have this storyboard where I have a animation that lasts 3 seconds. It's triggered by a Image Tap event, but I don't want the user to trigger it again before it is finished. The storyboard has a Completed event.

Is there I way I can lock the storyboard Begin and unlock it at Completed?

Upvotes: 1

Views: 108

Answers (1)

gleb.kudr
gleb.kudr

Reputation: 1508

You could wrap your control into class, add bool IfRunning property to that class and check it each time when user taps again.

your code will look similar to this:

(raise on Tap event)

if(IfRunning==false) 
{
IfRunning=true;
BeginAnimation();
}

... (raise in Completed event)

EndAnimation(); 
IfRunning=false;

Upvotes: 3

Related Questions