Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
286 lines (245 sloc) 17.2 KB
<Type Name="ElasticEase" FullName="System.Windows.Media.Animation.ElasticEase">
<TypeSignature Language="C#" Value="public class ElasticEase : System.Windows.Media.Animation.EasingFunctionBase" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit ElasticEase extends System.Windows.Media.Animation.EasingFunctionBase" />
<TypeSignature Language="DocId" Value="T:System.Windows.Media.Animation.ElasticEase" />
<TypeSignature Language="VB.NET" Value="Public Class ElasticEase&#xA;Inherits EasingFunctionBase" />
<TypeSignature Language="C++ CLI" Value="public ref class ElasticEase : System::Windows::Media::Animation::EasingFunctionBase" />
<TypeSignature Language="F#" Value="type ElasticEase = class&#xA; inherit EasingFunctionBase" />
<AssemblyInfo>
<AssemblyName>PresentationCore</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Windows.Media.Animation.EasingFunctionBase</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Represents an easing function that creates an animation that resembles a spring oscillating back and forth until it comes to rest.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can control when in the "spring" behavior occurs in an animation by specifying the <xref:System.Windows.Media.Animation.EasingFunctionBase.EasingMode%2A> property value. The following graph demonstrates the different values of <xref:System.Windows.Media.Animation.EasingFunctionBase.EasingMode%2A>, where *f*(*t*) represents the animation progress and *t* represents time.
![ElasticEase with graphs of different easingmodes.](~/add/media/elasticease-graph.png "ElasticEase with graphs of different easingmodes.")
You can specify how many times the animation oscillates back and forth using the <xref:System.Windows.Media.Animation.ElasticEase.Oscillations%2A> property and how tight the springiness of the oscillations are using the <xref:System.Windows.Media.Animation.ElasticEase.Springiness%2A> property.
> [!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. For example, if you apply this animation to the <xref:System.Windows.FrameworkElement.Height%2A> of an object (e.g. from 0 to 200 with an <xref:System.Windows.Media.Animation.EasingFunctionBase.EasingMode%2A> of <xref:System.Windows.Media.Animation.EasingMode.EaseIn>), the animation will attempt to interpolate through negative numbers for <xref:System.Windows.FrameworkElement.Height%2A> which will throw an error.
There are several other easing functions besides <xref:System.Windows.Media.Animation.ElasticEase>.
In addition to using the easing functions included in the run-time, you can create your own custom easing functions by inheriting from <xref:System.Windows.Media.Animation.EasingFunctionBase>.
## XAML Object Element Usage
```xaml
<ElasticEase .../>
```
## Examples
The following example applies an <xref:System.Windows.Media.Animation.ElasticEase> easing function to a <xref:System.Windows.Media.Animation.DoubleAnimation> to create an animation that resembles a spring oscillating back and forth until it comes to rest.
[!code-xaml[ElasticEase#ElasticEase](~/samples/snippets/csharp/VS_Snippets_Wpf/elasticease/CS/window1.xaml#elasticease)]
]]></format>
</remarks>
<altmember cref="T:System.Windows.Media.Animation.PowerEase" />
<altmember cref="T:System.Windows.Media.Animation.BackEase" />
<altmember cref="T:System.Windows.Media.Animation.BounceEase" />
<altmember cref="T:System.Windows.Media.Animation.CircleEase" />
<altmember cref="T:System.Windows.Media.Animation.CubicEase" />
<altmember cref="T:System.Windows.Media.Animation.ExponentialEase" />
<altmember cref="T:System.Windows.Media.Animation.QuadraticEase" />
<altmember cref="T:System.Windows.Media.Animation.QuarticEase" />
<altmember cref="T:System.Windows.Media.Animation.QuinticEase" />
<altmember cref="T:System.Windows.Media.Animation.SineEase" />
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public ElasticEase ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Media.Animation.ElasticEase.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; ElasticEase();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationCore</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Windows.Media.Animation.ElasticEase" /> class.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="CreateInstanceCore">
<MemberSignature Language="C#" Value="protected override System.Windows.Freezable CreateInstanceCore ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance class System.Windows.Freezable CreateInstanceCore() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Media.Animation.ElasticEase.CreateInstanceCore" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Function CreateInstanceCore () As Freezable" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override System::Windows::Freezable ^ CreateInstanceCore();" />
<MemberSignature Language="F#" Value="override this.CreateInstanceCore : unit -&gt; System.Windows.Freezable" Usage="elasticEase.CreateInstanceCore " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationCore</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Freezable</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Creates a new instance of the <see cref="T:System.Windows.Freezable" /> derived class. When creating a derived class, you must override this method.</summary>
<returns>The new instance.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Animation classes inherit indirectly from <xref:System.Windows.Freezable>. Because of this, you need to override the <xref:System.Windows.Media.Animation.BackEase.CreateInstanceCore%2A> method to construct a custom animation object.
## Examples
The following example shows a typical implementation of <xref:System.Windows.Freezable.CreateInstanceCore%2A>.
[!code-csharp[freezablesample_procedural#CreateInstanceCoreExample](~/samples/snippets/csharp/VS_Snippets_Wpf/freezablesample_procedural/CSharp/freezablesample.cs#createinstancecoreexample)]
[!code-vb[freezablesample_procedural#CreateInstanceCoreExample](~/samples/snippets/visualbasic/VS_Snippets_Wpf/freezablesample_procedural/visualbasic/freezablesample.vb#createinstancecoreexample)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="EaseInCore">
<MemberSignature Language="C#" Value="protected override double EaseInCore (double normalizedTime);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance float64 EaseInCore(float64 normalizedTime) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Media.Animation.ElasticEase.EaseInCore(System.Double)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Function EaseInCore (normalizedTime As Double) As Double" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override double EaseInCore(double normalizedTime);" />
<MemberSignature Language="F#" Value="override this.EaseInCore : double -&gt; double" Usage="elasticEase.EaseInCore normalizedTime" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationCore</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Double</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="normalizedTime" Type="System.Double" />
</Parameters>
<Docs>
<param name="normalizedTime">Normalized time (progress) of the animation.</param>
<summary>Provides the logic portion of the easing function that you can override to produce the <see cref="F:System.Windows.Media.Animation.EasingMode.EaseIn" /> mode of the custom easing function.</summary>
<returns>A double that represents the transformed progress.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method transforms normalized time to control the pace of an animation for the <xref:System.Windows.Media.Animation.EasingMode.EaseIn> case of <xref:System.Windows.Media.Animation.EasingFunctionBase.EasingMode%2A>.
You only have to specify your easing function for the <xref:System.Windows.Media.Animation.EasingMode.EaseIn> case because the implementation of the <xref:System.Windows.Media.Animation.EasingFunctionBase.Ease%2A> method transforms `normalizedTime` for the <xref:System.Windows.Media.Animation.EasingMode.EaseOut> and <xref:System.Windows.Media.Animation.EasingMode.EaseInOut> cases.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Oscillations">
<MemberSignature Language="C#" Value="public int Oscillations { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 Oscillations" />
<MemberSignature Language="DocId" Value="P:System.Windows.Media.Animation.ElasticEase.Oscillations" />
<MemberSignature Language="VB.NET" Value="Public Property Oscillations As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property int Oscillations { int get(); void set(int value); };" />
<MemberSignature Language="F#" Value="member this.Oscillations : int with get, set" Usage="System.Windows.Media.Animation.ElasticEase.Oscillations" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationCore</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the number of times the target slides back and forth over the animation destination.</summary>
<value>The number of times the target slides back and forth over the animation destination. This value must be greater than or equal to 0. The default is 3.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
[!INCLUDE[DP_ID_field_label](~/includes/dp-id-field-label-md.md)] <xref:System.Windows.Media.Animation.ElasticEase.OscillationsProperty>
<a name="xamlAttributeUsage_Occilations"></a>
## XAML Attribute Usage
```
<ElasticEase Oscillations="int"/>
```
## Examples
The following example applies an <xref:System.Windows.Media.Animation.ElasticEase> easing function to a <xref:System.Windows.Media.Animation.DoubleAnimation> to create an animation that resembles a spring oscillating back and forth until it comes to rest.
[!code-xaml[ElasticEase#ElasticEase](~/samples/snippets/csharp/VS_Snippets_Wpf/elasticease/CS/window1.xaml#elasticease)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="OscillationsProperty">
<MemberSignature Language="C#" Value="public static readonly System.Windows.DependencyProperty OscillationsProperty;" />
<MemberSignature Language="ILAsm" Value=".field public static initonly class System.Windows.DependencyProperty OscillationsProperty" />
<MemberSignature Language="DocId" Value="F:System.Windows.Media.Animation.ElasticEase.OscillationsProperty" />
<MemberSignature Language="VB.NET" Value="Public Shared ReadOnly OscillationsProperty As DependencyProperty " />
<MemberSignature Language="C++ CLI" Value="public: static initonly System::Windows::DependencyProperty ^ OscillationsProperty;" />
<MemberSignature Language="F#" Value=" staticval mutable OscillationsProperty : System.Windows.DependencyProperty" Usage="System.Windows.Media.Animation.ElasticEase.OscillationsProperty" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationCore</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.DependencyProperty</ReturnType>
</ReturnValue>
<Docs>
<summary>Identifies the <see cref="P:System.Windows.Media.Animation.ElasticEase.Oscillations" /> dependency property.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Springiness">
<MemberSignature Language="C#" Value="public double Springiness { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance float64 Springiness" />
<MemberSignature Language="DocId" Value="P:System.Windows.Media.Animation.ElasticEase.Springiness" />
<MemberSignature Language="VB.NET" Value="Public Property Springiness As Double" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property double Springiness { double get(); void set(double value); };" />
<MemberSignature Language="F#" Value="member this.Springiness : double with get, set" Usage="System.Windows.Media.Animation.ElasticEase.Springiness" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationCore</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Double</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the stiffness of the spring. The smaller the Springiness value is, the stiffer the spring and the faster the elasticity decreases in intensity over each oscillation.</summary>
<value>A positive number that specifies the stiffness of the spring. The default value is 3.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The smaller the <xref:System.Windows.Media.Animation.ElasticEase.Springiness%2A> value is, the stiffer the spring and the faster the elasticity decreases in intensity over each oscillation.
[!INCLUDE[DP_ID_field_label](~/includes/dp-id-field-label-md.md)] <xref:System.Windows.Media.Animation.ElasticEase.SpringinessProperty>
The following diagram illustrates the effect of different values of <xref:System.Windows.Media.Animation.ElasticEase.Springiness%2A>.
![Demonstrates different Springiness values.](~/add/media/elasticease-springiness.png "Demonstrates different Springiness values.")
<a name="xamlAttributeUsage_Springiness"></a>
## XAML Attribute Usage
```
<ElasticEase Springiness="double"/>
```
## Examples
The following example applies an <xref:System.Windows.Media.Animation.ElasticEase> easing function to a <xref:System.Windows.Media.Animation.DoubleAnimation> to create an animation that resembles a spring oscillating back and forth until it comes to rest.
[!code-xaml[ElasticEase#ElasticEase](~/samples/snippets/csharp/VS_Snippets_Wpf/elasticease/CS/window1.xaml#elasticease)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="SpringinessProperty">
<MemberSignature Language="C#" Value="public static readonly System.Windows.DependencyProperty SpringinessProperty;" />
<MemberSignature Language="ILAsm" Value=".field public static initonly class System.Windows.DependencyProperty SpringinessProperty" />
<MemberSignature Language="DocId" Value="F:System.Windows.Media.Animation.ElasticEase.SpringinessProperty" />
<MemberSignature Language="VB.NET" Value="Public Shared ReadOnly SpringinessProperty As DependencyProperty " />
<MemberSignature Language="C++ CLI" Value="public: static initonly System::Windows::DependencyProperty ^ SpringinessProperty;" />
<MemberSignature Language="F#" Value=" staticval mutable SpringinessProperty : System.Windows.DependencyProperty" Usage="System.Windows.Media.Animation.ElasticEase.SpringinessProperty" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationCore</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.DependencyProperty</ReturnType>
</ReturnValue>
<Docs>
<summary>Identifies the <see cref="P:System.Windows.Media.Animation.ElasticEase.Springiness" /> dependency property.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.