EasingDoubleKeyFrame class

Applies to Windows and Windows Phone

Associates an easing function with a DoubleAnimationUsingKeyFrames key-frame animation.

Inheritance

Object
  DependencyObject
    DoubleKeyFrame
      EasingDoubleKeyFrame

Syntax


public sealed class EasingDoubleKeyFrame : DoubleKeyFrame


<EasingDoubleKeyFrame .../>

Attributes

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]
[WebHostHidden()]

Members

The EasingDoubleKeyFrame class has these types of members:

Constructors

The EasingDoubleKeyFrame class has these constructors.

ConstructorDescription
EasingDoubleKeyFrame Initializes a new instance of the EasingDoubleKeyFrame class.

 

Methods

The EasingDoubleKeyFrame class has these methods. It also inherits methods from the Object class.

MethodDescription
ClearValue Clears the local value of a dependency property. (Inherited from DependencyObject)
GetAnimationBaseValue Returns any base value established for a dependency property, which would apply in cases where an animation is not active. (Inherited from DependencyObject)
GetValue Returns the current effective value of a dependency property from a DependencyObject. (Inherited from DependencyObject)
ReadLocalValue Returns the local value of a dependency property, if a local value is set. (Inherited from DependencyObject)
SetValue Sets the local value of a dependency property on a DependencyObject. (Inherited from DependencyObject)

 

Properties

The EasingDoubleKeyFrame class has these properties.

PropertyAccess typeDescription

Dispatcher

Read-onlyGets the CoreDispatcher that this object is associated with. (Inherited from DependencyObject)

EasingFunction

Read/writeGets or sets the easing function that is applied to the key frame.

EasingFunctionProperty

Read-onlyIdentifies the EasingFunction dependency property.

KeyTime

Read/writeGets or sets the time at which the key frame's target Value should be reached. (Inherited from DoubleKeyFrame)

Value

Read/writeGets or sets the key frame's target value. (Inherited from DoubleKeyFrame)

 

Remarks

Easing functions allow you to apply custom mathematical formulas to your animations. Mathematical operations are often useful to produce animations that simulate real-world physics in a 2-D coordinate system. For example, you may want an object to realistically bounce or behave as though it were on a spring. For a list of easing functions and info on how to use them, see Key-frame animations and easing function animations.

Examples

This XAML example shows how to use key frames that have easing functions associated with them to create an animation of a rectangle that contracts upward, slows down, then expands downward (as though falling), and then bounces to a stop.


<StackPanel x:Name="LayoutRoot" >
    <StackPanel.Resources>
        <Storyboard x:Name="myStoryboard">
            <DoubleAnimationUsingKeyFrames
             Storyboard.TargetProperty="Height"
             Storyboard.TargetName="myRectangle" EnableDependentAnimation="true">

                <!-- This keyframe animates the ellipse up to the crest 
                     where it slows down and stops. -->
                <EasingDoubleKeyFrame Value="30" KeyTime="00:00:02">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CubicEase EasingMode="EaseOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>

                <!-- This keyframe animates the ellipse back down and makes
                     it bounce. -->
                <EasingDoubleKeyFrame Value="200" KeyTime="00:00:06">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <BounceEase Bounces="5" EasingMode="EaseOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>

            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </StackPanel.Resources>

    <Rectangle x:Name="myRectangle" PointerPressed="Pointer_Clicked" 
     Fill="Blue" Width="200" Height="200" />
</StackPanel>



// When the user clicks the rectangle, the animation
// begins. 
private void Pointer_Clicked(object sender, PointerRoutedEventArgs e)
{
    myStoryboard.Begin();
}


Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Media.Animation
Windows::UI::Xaml::Media::Animation [C++]

Metadata

Windows.winmd

See also

Storyboarded animations
Key-frame animations and easing function animations
XAML animation sample
DoubleKeyFrame
EasingColorKeyFrame
EasingPointKeyFrame
KeyTime
Value

 

 

Show:
© 2014 Microsoft