IXRElasticEase (Compact 2013)

3/28/2014

This class includes easing functions that help create animations that resemble a spring oscillating back and forth until it comes to rest.

Syntax

class IXRElasticEase : public IXREasingFunctionBase

Inheritance Hierarchy

IXRDependencyObject

    IXREasingFunctionBase

        IXRElasticEase

Methods

Method

Description

IXRElasticEase::GetOscillations

Retrieves the number of times the animation target slides back and forth over the animation destination.

IXRElasticEase::GetSpringiness

Retrieves the value that represents the stiffness of the spring.

IXRElasticEase::SetOscillations

Sets the number of times the animation target slides back and forth.

IXRElasticEase::SetSpringiness

Sets the stiffness of the spring. The smaller the Springiness value, the stiffer the spring and the faster the elasticity decreases in intensity over each oscillation.

Thread Safety

Members of this class are thread safe if you previously called IXRApplication::CreateHostFromXaml and supplied it with an XRWindowCreateParams structure that has AllowsMultipleThreadAccess set to true.

Remarks

You can control when the spring behavior occurs in an animation by passing one of the XREasingMode enumerated values to the inherited IXREasingFunctionBase::SetEasingMode method. The following graphs demonstrate the different values of the easing mode, where f(t) represents the animation progress and t represents time.

Easing function

XREasingMode_EaseIn

XREasingMode_EaseOut

XREasingMode_EaseInOut

IXRElasticEase

Gg156351.4e950b6e-11c0-4525-a8c4-3df31cd6d76d(en-us,WinEmbedded.80).jpg
Gg156351.fdbc9edd-bcc8-439f-a126-4203a9cd994a(en-us,WinEmbedded.80).jpg
Gg156351.e1cb733f-eaca-4330-9898-03a91684784b(en-us,WinEmbedded.80).jpg

You can specify how many times the animation oscillates back and forth by using the IXRElasticEase::SetOscillations method and how springy the oscillations are by using the IXRElasticEase::SetSpringiness method.

Note

Because this animation causes values to oscillate back and forth, the animation might interpolate into negative numbers unexpectedly. This can cause errors when animating properties that do not allow negative numbers.

When you create a class instance, use an IXRElasticEasePtr smart pointer instead of a raw interface pointer. For more information, see XRPtr<Interface>.

You can apply this easing function to an animation in Microsoft Silverlight 3 XAML. For information about the differences between XAML in XAML for Windows Embedded and Silverlight 3, see Differences Between Microsoft Silverlight 3 and XAML for Windows Embedded. For more information about how to define this element in the source XAML for your application, see the ElasticEase Class on MSDN.

There are several other easing functions besides IXRElasticEase that you can explore using the following sample:

Run the sample

.NET Framework Equivalent

System.Windows.Media.Animation.ElasticEase

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

Classes for Animation Storyboards
IXREasingFunctionBase::SetEasingMode