There are new capabilities for the animation system in Silverlight 3. Various classes such as the;

DoubleAnimation

PointAnimation

ColorAnimation

get a new dependency property called EasingFunction which is an instance of an interface IEasingFunction which has a single method on it;

double Ease(double normalizedTime);

the idea being that this can take a “normalised time” into an animation (e.g. a range from 0.0 to 1.0) and apply some function in order to determine “where” the animation should be at that particular point in time.

In Silverlight 2, there were special cases of this in that the standard animation types perform linear interpolation between two values and there’s also the KeyFrame based animations which allow you to specify particular values at discrete time intervals but Silverlight 3 comes along and generalises it ( you can implement IEasingFunction yourself and there’s a base class EasingFunctionBase to help ) and also provides some stock easing functions in the box;

BackEase

BounceEase

CircleEase

CubicEase

ElasticEase

ExponentialEase

PowerEase

QuadraticEase

QuarticEase

QuinticEase

SineEase

and each of these ( because of deriving from EasingFunctionBase ) pick up a property of type EasingMode which can be EaseOut, EaseIn and EaseInOut.

It’s easy to write some code to demonstrate these although note that each one has different properties to reflect its individual behaviour and I’m leaving all those properties to their default values here rather than try to write UI to display all the different ones;

which would then have my Ellipse use an ElasticEase for the first half of its animation and then a BounceEase to the end of its animation.

It’s easy to plug in your own easing functions ( much harder to come up with any new ones given how many are already plugged in to the framework ) – you could consider the “Null” easing function to be something like;

(C) Mike Taulty, 2015. All rights reserved. The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Inappropriate comments will be deleted at the authors discretion. All code samples are provided "AS IS" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.