I’m doing a DoubleAnimation not using the StoryBoard and I’m trying to apply an event handler to when it’s finished (otherwise code I’m trying to do is happening before animation ends)
I have used :
da = new DoubleAnimation(40,20, new Duration(TimeSpan.FromSeconds(2)));
((PerspectiveCamera)_Main3D.Camera).
BeginAnimation(PerspectiveCamera.FieldOfViewProperty, da);
da.Completed += new EventHandler(Story_Completed);
Yet this event never occours.
You’re attaching an event handler after you start the animation. If the animation is brief then it’s possible that it finishes before the Completed handler is ever assigned. It’s also possible that the animation object doesn’t respond to handler assignment while running an animation.
Try this:
…add the Competed handler before starting the animation…