 |
AnimationController Methods |
The AnimationController type exposes the following members.
Methods | Name | Description |
---|
 | Dump |
Writes details about this AnimationNodeBase to the Visual Studio Output window.
This method calls the GetDumpString method to get details about each keyframe.
|
 | GetAnimationPauseTimeInSeconds |
Returns total elapsed time in seconds in which the animation was paused (time during PauseAnimation and ResumeAnimation method calls).
|
 | GetAnimationTimeInSeconds |
Returns time in seconds that elapsed from the start of the animation (time after calling StartAnimation(Boolean) or StartAnimation(Double, Boolean)). The pause time is not included in the returned time.
If animation was not started, 0 is returned.
To get the elapsed time to some specified time use the GetAnimationTimeInSeconds(DateTime) method that takes time as parameter.
|
 | GetAnimationTimeInSeconds(DateTime) |
Returns time in seconds that elapsed from the start of the animation to the time specified as a parameter to this method. The pause time is not included in the returned time.
When animation is started with startFrameNumber parameter, then the animation time is increased by the startFrameNumber divided by FramesPerSecond.
If animation was not started, 0 is returned.
|
 | GetDumpString |
GetDumpString virtual method can be overridden to provide detailed description of this object.
|
 | GetFrameNumber |
GetFrameNumber returns a double that specifies the current frame number (can be a fraction between two integer values).
The number is calculated based on the current animation time (get with calling GetAnimationTimeInSeconds method).
If the animation was not yet starter or first frame was not yet reached, then -1 us returned.
When animation has passed the last frame and the animation is not repeating, then the last frame number is returned.
|
 | GetFrameNumber(Double) |
GetFrameNumber returns a double that specifies the frame number at the specified animationTimeInSeconds (can be a fraction between two integer values).
If the animation was not yet starter or first frame was not yet reached, then -1 us returned.
When animation has passed the last frame and the animation is not repeating, then the last frame number is returned.
|
 | GoToFrame |
GoToFrame method updates the objects animated with this animation node based on the specified frame number.
The method calls GoToFrame(Double) method on all AnimationNodes objects.
|
 | OnAfterFrameUpdated |
OnAfterFrameUpdated fires AfterFrameUpdated event
|
 | OnAnimationCompleted |
OnAnimationCompleted fires AnimationCompleted event
|
 | OnAnimationStarted |
OnAnimationStarted fires AnimationStarted event
|
 | OnAnimationStopped |
OnAnimationStopped fires AnimationStopped event
|
 | OnBeforeFrameUpdated |
OnBeforeFrameUpdated fires BeforeFrameUpdated event
|
 | PauseAnimation |
PauseAnimation method pauses the animation. After pausing the animation, the call to GetFrameNumber method will return the frame number at the moment of pausing the animation.
To resume the animation call the ResumeAnimation method.
|
 | ResumeAnimation |
ResumeAnimation method resumes the animation after it was paused with PauseAnimation method.
|
 | StartAnimation(Boolean) |
StartAnimation method starts the animation in this AnimationController. If the animation was paused, this method continues the animation (is the same as ResumeAnimation method).
When the subscribeToRenderingEvent parameter is true (by default), then animation controller subscribes to the WPF's RenderingEvent
and automatically updates the animated objects by calling GetFrameNumber and GoToFrame(Double) methods.
If subscribeToRenderingEvent is false, user needs to manually call GetFrameNumber or other methods to update the animated objects.
|
 | StartAnimation(Double, Boolean) |
StartAnimation method starts the animation in this AnimationController. If the animation was paused, this method continues the animation (is the same as ResumeAnimation method).
When the subscribeToRenderingEvent parameter is true (by default), then animation controller subscribes to the WPF's RenderingEvent
and automatically updates the animated objects by calling GetFrameNumber and GoToFrame(Double) methods.
If subscribeToRenderingEvent is false, user needs to manually call GetFrameNumber or other methods to update the animated objects.
|
 | StopAnimation |
StopAnimation method stops the animation. After animation has been stopped, the call to GetFrameNumber method will return the first frame (index = 0).
|
Top
See Also