c# - Apply easing function to animation behind code -
i managed build storyboard behind code. don't know how add easing functions though. looking like:
doubleanimation fadelntbanimation = new doubleanimation(); fadelntbanimation.to = 0; fadelntbanimation.begintime = timespan.fromseconds(0); fadelntbanimation.duration = new duration(timespan.fromseconds(1)); fadelntbanimation.easingfunction = easingmode.easeinout; // line gives error
how apply easing functions c#?
the reason why find useful build storyboard code because applying same animation several objects , not work when bind target property in xaml.
you need create instance of ieasingfunction (http://msdn.microsoft.com/en-us/library/system.windows.media.animation.ieasingfunction.aspx). there list of implementation classes @ bottom of documentation entry, common of cubicease or quadraticease.
Comments
Post a Comment