IAnimatableObject

References
public interface IAnimatableObject
Implemented by document objects which can be driven by an animation. An animatable object can snapshot its own state, describe the two extremes it is able to reach, and move itself to the state belonging to a frame.

Properties

CanAnimate

#
Gets whether this object can currently be animated. An object which returns false is skipped, even if an animation binding targets it.
bool CanAnimate { get; }

Methods

Animate

#
Move this object to the state belonging to a frame.

currentFrame runs from zero to totalFrames minus one: frame zero is start and the final frame is end. When the start and end states are identical, or when the totalFrames equals zero, the animation server is putting this object back into an original (not-animated) state.

Implementers must change the state of the object to match the interpolated animation states, but they should *not* record undo events or trigger new solutions.

IObjectState Animate(
start,
State belonging to frame zero.
end,
State belonging to the final frame.
currentFrame,
Index of the frame to apply.
totalFrames
Number of frames spanning the two states.
)
The state which was applied.

GetCurrentState

#
Snapshot the current state of this object, along with the two extremes it can reach.
IObjectState GetCurrentState(
lowest,
The lowest state this object can hold.
highest
The highest state this object can hold.
)
The current state.

SuggestedFrameCount

#
Gets the number of frames which would suit an animation between two states, or zero if this object has no opinion.

An object with a finite number of states answers with how many of them lie between the two, so the animation visits each exactly once. An object of unlimited accuracy — an angle or a number line, say — answers with whatever sampling is natural over that range instead, since it is the one which knows what a sensible step through its own values looks like. Nothing else is in a position to guess.

It depends on the states because the range does: a slider covering a tenth of its domain has a tenth of the values to visit.

Both states are always supplied. A binding with no limits of its own passes the extremes this object reported from GetCurrentState(IObjectState, IObjectState), so there is never a missing state to defend against — only, as ever, the possibility of one belonging to some other object.

long SuggestedFrameCount(
start,
State belonging to the first frame.
end
State belonging to the last frame.
)