Silverlight 3 Quick Tip: Animation Easing and VSM

July 10, 2009

New version of VSM in Silverlight 3 got new interesting addition – ability to use Easing Function for visual state transition animation.

To use it, set the property “GeneratedEasingFunction” to desired VisuaStateTransition element and provide it with class instance with implements IEasingFunction.

From XAML:
<vsm:VisualTransition GeneratedDuration="00:00:10"
                               
To="ItemDeselected" x:Name="vtDeselected" >
  <
vsm:VisualTransition.GeneratedEasingFunction>
    <
ElasticEase Oscillations="10" Springiness="2"/>
  </
vsm:VisualTransition.GeneratedEasingFunction>
</
vsm:VisualTransition>

From Code Behind:
ElasticEase ease = new ElasticEase();
ease.EasingMode = EasingMode.EaseInOut;
ease.Oscillations = 15;
ease.Springiness = 1;
vtDeselected.GeneratedEasingFunction = ease;

 

Enjoy,

Alex

Add comment
facebook linkedin twitter email

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*

4 comments

  1. Kelli GarnerSeptember 26, 2009 ב 0:11

    Thats very good to know… thanks

    Reply
  2. Carl AnglingNovember 27, 2009 ב 19:04

    Good work here… effort definately pays off as you have a ncie site

    Reply
  3. Power Home Solar ReviewJanuary 27, 2010 ב 5:10

    Great site, I will be back. Well done

    Reply