AnimationBinding

References
public sealed class AnimationBinding : IStorable
A single binding between an animation and one animatable object in the document.

Bindings reference their object by instance id rather than by reference, so a binding survives a document reload and tolerates an object which has been deleted and restored by an undo.

Constructors

AnimationBinding

#
Create a new, enabled binding targeting a specific object.
public AnimationBinding(
objectId
Instance id of the object to animate.
)

AnimationBinding

#
Deserialisation constructor.
public AnimationBinding(
reader
)

Properties

Enabled

#
Gets or sets whether this inding takes part in the animation.
public bool Enabled { get; set; }

End

#
Gets or sets the state this object holds on the last frame, or null to end at the highest state it can reach.
public IObjectState End { get; set; }

ObjectId

#
Gets the instance id of the animated object.
public Guid ObjectId { get; }

Start

#
Gets or sets the state this object holds on the first frame, or null to start from the lowest state it can reach.
public IObjectState Start { get; set; }

Methods

Resolve

#
Resolve the animatable object this binding targets.
public IAnimatableObject Resolve(
document
Document to search.
)
The animatable object, or null if it is missing, not animatable, or unable to animate at this moment.

ResolveLimits

#
Work out the two states this binding actually animates between.

A limit which was never set falls back to the far end of whatever range the object can reach, so a new binding animates everything without having to store anything.

public bool ResolveLimits(
animatable,
Object to resolve against.
start,
State for the first frame.
end
State for the last frame.
)
True if both limits came from this binding rather than from the object.

ResolveName

#
Resolve the display name of the animated object, for use in user interfaces.
public string ResolveName(
document
)

SeedLimits

#
Give this binding concrete limits, taken from the range its object reports, unless it already has them.

Done when an object joins an animation, so that the limits stop being a live reading of the object and become a decision. An object with no range of its own — a colour, say, which reports its current value for both ends — would otherwise have one limit follow it around while the other was being set, and the two would always agree.

public void SeedLimits()

Store

#
This method is called whenever the instance is required to serialize itself.
public void Store(
writer
Writer object to serialize with.
)
Store