PointAnimationUsingKeyFrames class
TOC
Collapse the table of content
Expand the table of content

PointAnimationUsingKeyFrames class

Animates the value of a Point property along a set of KeyFrames.

Inheritance

Object
  DependencyObject
    Timeline
      PointAnimationUsingKeyFrames

Syntax


public ref class PointAnimationUsingKeyFrames sealed : Timeline


<PointAnimationUsingKeyFrames>
  oneOrMorePointKeyFrames
</PointAnimationUsingKeyFrames>

XAML Values

oneOrMorePointKeyFrames

One or more object elements that define the key frames for the animation. These object elements represent one of the classes deriving from PointKeyFrame. These are typically any combination of LinearPointKeyFrame, EasingPointKeyFrame, DiscretePointKeyFrame, and SplinePointKeyFrame. Object elements defined here become members of the collection when code accesses the KeyFrames property at run time.

Members

The PointAnimationUsingKeyFrames class has these types of members:

Constructors

The PointAnimationUsingKeyFrames class has these constructors.

ConstructorDescription
PointAnimationUsingKeyFrames Initializes a new instance of the PointAnimationUsingKeyFrames class.

 

Events

The PointAnimationUsingKeyFrames class has these events.

EventDescription
Completed Occurs when the Storyboard object has completed playing. (Inherited from Timeline)

 

Methods

The PointAnimationUsingKeyFrames 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)
RegisterPropertyChangedCallback Registers a notification function for listening to changes to a specific DependencyProperty on this DependencyObject instance. (Inherited from DependencyObject)
SetValue Sets the local value of a dependency property on a DependencyObject. (Inherited from DependencyObject)
UnregisterPropertyChangedCallback Cancels a change notification that was previously registered by calling RegisterPropertyChangedCallback. (Inherited from DependencyObject)

 

Properties

The PointAnimationUsingKeyFrames class has these properties.

PropertyAccess typeDescription

AutoReverse

Read/write

Gets or sets a value that indicates whether the timeline plays in reverse after it completes a forward iteration. (Inherited from Timeline)

BeginTime

Read/write

Gets or sets the time at which this Timeline should begin. (Inherited from Timeline)

Dispatcher

Read-only

Gets the CoreDispatcher that this object is associated with. The CoreDispatcher represents a facility that can access the DependencyObject on the UI thread even if the code is initiated by a non-UI thread. (Inherited from DependencyObject)

Duration

Read/write

Gets or sets the length of time for which this timeline plays, not counting repetitions. (Inherited from Timeline)

EnableDependentAnimation

Read/write

Gets or sets a value that declares whether animated properties that are considered dependent animations should be permitted to use this animation declaration.

EnableDependentAnimationProperty

Read-only

Identifies the EnableDependentAnimation dependency property.

FillBehavior

Read/write

Gets or sets a value that specifies how the animation behaves after it reaches the end of its active period. (Inherited from Timeline)

KeyFrames

Read-only

Gets the collection of PointKeyFrame objects that define the animation.

RepeatBehavior

Read/write

Gets or sets the repeating behavior of this timeline. (Inherited from Timeline)

SpeedRatio

Read/write

Gets or sets the rate, relative to its parent, at which time progresses for this Timeline. (Inherited from Timeline)

 

Examples

The following example moves an ellipse along a triangular path. The example uses the PointAnimationUsingKeyFrames class to animate the Center property of an EllipseGeometry. This animation uses three key frames in the following manner:

  1. During the first half second, it uses an instance of the LinearPointKeyFrame class to move the ellipse along a path at a steady rate from its starting position. Linear key frames such as LinearPointKeyFrame create a smooth linear interpolation between values.

  2. During the end of the next half second, it uses an instance of the DiscretePointKeyFrame class to suddenly move the ellipse along the path to the next position. Discrete key frames like DiscretePointKeyFrame create sudden jumps between values.

  3. During the final two seconds, it uses an instance of the SplinePointKeyFrame class to move the ellipse back to its starting position. Spline key frames like SplinePointKeyFrame create a variable transition between values according to the values of the KeySpline property. In this example, the animation begins slowly and speeds up exponentially toward the end of the time segment.


<Canvas Width="400" Height="300">
    <Canvas.Resources>
        <Storyboard x:Name="myStoryboard">

            <!-- Animating the Center property uses 3 KeyFrames, which animate
             the ellipse allong a triangular path. -->
            <PointAnimationUsingKeyFrames
          Storyboard.TargetProperty="Center"
          Storyboard.TargetName="MyAnimatedEllipseGeometry"
          Duration="0:0:5" RepeatBehavior="Forever" EnableDependentAnimation="True">

                <!-- Over the first half second, Using a LinearPointKeyFrame, the ellipse 
               moves steadily from its starting position along the first line of the 
               trianglar path.  -->
                <LinearPointKeyFrame KeyTime="0:0:0.5" Value="100,300" />

                <!-- Using a DiscretePointKeyFrame, the ellipse suddenly changes position
               after the first second of the animation. -->
                <DiscretePointKeyFrame KeyTime="0:0:1" Value="400,300" />

                <!-- Using a SplinePointKeyFrame, the ellipse moves back to its starting
               position. It moves slowly at first and then speeds up. This key frame 
               takes 2 seconds to complete. -->
                <SplinePointKeyFrame KeySpline="0.6,0.0 0.9,0.00" 
                 KeyTime="0:0:3" Value="200,100" />
            </PointAnimationUsingKeyFrames>
        </Storyboard>
    </Canvas.Resources>
    <Path Fill="Blue" Loaded="Start_Animation">
        <Path.Data>

            <!-- Describes an ellipse. -->
            <EllipseGeometry x:Name="MyAnimatedEllipseGeometry"
             Center="200,100" RadiusX="15" RadiusY="15" />
        </Path.Data>
    </Path>
</Canvas>


No code example is currently available or this language may not be supported.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

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

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

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

Attributes

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

See also

Object
Storyboarded animations

 

 

Show:
© 2016 Microsoft