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
IXRElasticEase
Methods
Method |
Description |
---|---|
Retrieves the number of times the animation target slides back and forth over the animation destination. |
|
Retrieves the value that represents the stiffness of the spring. |
|
Sets the number of times the animation target slides back and forth. |
|
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 |
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:
.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