Easing multiple properties

Using an object array, you can ease multiple properties on an object

Application.Current.RootVisual.MouseLeftButtonDown += (s, args) =>
    // position info
    Point pt = args.GetPosition(null);

    // transition info
    double time = .8;
    double delay = 0;
    PercentHandler ease = AnimationTransitions.CubicEaseOut;

    // ease
           new object[] { AnimationTypes.X, AnimationTypes.Y },
           new object[] { pt.X, pt.Y },
           time, ease, delay);

Last edited Mar 2, 2010 at 7:48 PM by jgraup, version 2


spacexplorer Nov 24, 2010 at 1:49 AM 
I had an issue - the discussion can be found here:

Ok - I found the answer - I will also add the comment on the page where i got the example from:


first I declare a field in my class to hold the value I want to animate:

private Double testValue = 5;

then I declare the const string as in the example

public const string screenValue = "screenValue";

now in my constructor of the class I do the rest:

var screenValueGetterSetter = new GetterSetter
Getter = (obj, data) => obj,
Setter = (obj, data, per) =>
//this was from the example
//GetterSetterData.EaseValue throws an error
//var c = GetterSetterData.EaseValue((Double)data.ValueStart, (Double)data.ValueEnd, per);
//EaseHelper.EaseValue works!!!!!!
var c = EaseHelper.EaseValue((Double)data.ValueStart, (Double)data.ValueEnd, per);
Console.WriteLine("testing values obj{0}, data{1}, per{2}, c{3}", obj, data, per, c);
//the following line from the example does nothing
var o = (Double)obj;
//setting the value directly works
testValue = c;

//now to test the function
AnimationTypes.RegisterGetterSetter("screenValue", screenValueGetterSetter);
ArtefactAnimator.AddEase(testValue, "screenValue", 50, 5).OnUpdate((eo, p) => Console.WriteLine("updating test: {0}",testValue));

thanks for a great Library - I come from Director/Flash - and I am an Interaction Designer - not a Software Engineer