Export (0) Print
Expand All
1 out of 1 rated this helpful - Rate this topic

PointAnimation Class

Animates the value of a Point property between two target values using linear interpolation over a specified Duration.

Namespace:  System.Windows.Media.Animation
Assembly:  System.Windows (in System.Windows.dll)
public sealed class PointAnimation : Timeline
<PointAnimation .../>

The PointAnimation type exposes the following members.

  NameDescription
Public methodSupported by Silverlight for Windows PhonePointAnimationInitializes a new instance of the PointAnimation class.
Top
  NameDescription
Public propertySupported by Silverlight for Windows PhoneAutoReverseGets or sets a value that indicates whether the timeline plays in reverse after it completes a forward iteration. (Inherited from Timeline.)
Public propertySupported by Silverlight for Windows PhoneBeginTimeGets or sets the time at which this Timeline should begin. (Inherited from Timeline.)
Public propertySupported by Silverlight for Windows PhoneByGets or sets the total amount by which the animation changes its starting value.
Public propertySupported by Silverlight for Windows PhoneDispatcherGets the Dispatcher this object is associated with. (Inherited from DependencyObject.)
Public propertySupported by Silverlight for Windows PhoneDurationGets or sets the length of time for which this timeline plays, not counting repetitions. (Inherited from Timeline.)
Public propertySupported by Silverlight for Windows PhoneEasingFunctionGets or sets the easing function you are applying to the animation.
Public propertySupported by Silverlight for Windows PhoneFillBehaviorGets or sets a value that specifies how the animation behaves after it reaches the end of its active period. (Inherited from Timeline.)
Public propertySupported by Silverlight for Windows PhoneFromGets or sets the animation's starting value.
Public propertySupported by Silverlight for Windows PhoneRepeatBehaviorGets or sets the repeating behavior of this timeline. (Inherited from Timeline.)
Public propertySupported by Silverlight for Windows PhoneSpeedRatioGets or sets the rate, relative to its parent, at which time progresses for this Timeline. (Inherited from Timeline.)
Public propertySupported by Silverlight for Windows PhoneToGets or sets the animation's ending value.
Top
  NameDescription
Public methodSupported by Silverlight for Windows PhoneCheckAccessDetermines whether the calling thread has access to this object. (Inherited from DependencyObject.)
Public methodSupported by Silverlight for Windows PhoneClearValueClears the local value of a dependency property. (Inherited from DependencyObject.)
Public methodSupported by Silverlight for Windows PhoneEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows PhoneFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneGetAnimationBaseValueReturns any base value established for a Silverlight dependency property, which would apply in cases where an animation is not active. (Inherited from DependencyObject.)
Public methodSupported by Silverlight for Windows PhoneGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneGetValueReturns the current effective value of a dependency property from a DependencyObject. (Inherited from DependencyObject.)
Protected methodSupported by Silverlight for Windows PhoneMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneReadLocalValueReturns the local value of a dependency property, if a local value is set. (Inherited from DependencyObject.)
Public methodSupported by Silverlight for Windows PhoneSetValueSets the local value of a dependency property on a DependencyObject. (Inherited from DependencyObject.)
Public methodSupported by Silverlight for Windows PhoneToStringReturns a string that represents the current object. (Inherited from Object.)
Top
  NameDescription
Public eventSupported by Silverlight for Windows PhoneCompletedOccurs when the Storyboard object has completed playing. (Inherited from Timeline.)
Top
  NameDescription
Public fieldStatic memberSupported by Silverlight for Windows PhoneByPropertyIdentifies the By dependency property.
Public fieldStatic memberSupported by Silverlight for Windows PhoneEasingFunctionPropertyIdentifies the EasingFunction dependency property.
Public fieldStatic memberSupported by Silverlight for Windows PhoneFromPropertyIdentifies the From dependency property.
Public fieldStatic memberSupported by Silverlight for Windows PhoneToPropertyIdentifies the To dependency property.
Top

An animation updates the value of a property over a period of time. An animation effect can be subtle, such as moving a Shape a few pixels left and right, or dramatic, such as enlarging an object to 200 times its original size while spinning it and changing its color. To create an animation, you must associate an animation with an object's property value.

Target Values

The PointAnimation class creates a transition between two target values. To set its target values, use its From, To, and By properties.  The following table summarizes how the From, To, and By properties can be used together or separately to determine an animation's target values.

Properties specified

Resulting behavior

From

The animation progresses from the value specified by the From property to the base value of the property being animated or to a previous animation's output value, depending on how the previous animation is configured.

From and To

The animation progresses from the value specified by the From property to the value specified by the To property.

From and By

The animation progresses from the value specified by the From property to the value specified by the sum of the From and By properties.

To

The animation progresses from the animated property's base value or a previous animation's output value to the value specified by the To property.

By

The animation progresses from the base value of the property being animated or a previous animation's output value to the sum of that value and the value specified by the By property.

NoteNote:

If you set both the To and By properties, the To property takes precedence and the By property is ignored.

To use other interpolation methods or animate between more than two target values, use a PointAnimationUsingKeyFrames object.

The following example shows how to use the PointAnimation to animate the Center property of an EllipseGeometry.

Run this sample


<Canvas Width="450" Height="350">
    <Canvas.Resources>
        <Storyboard x:Name="myStoryboard">

            <!-- Animate the center point of the ellipse from 100 X, 300 Y
             to 400 X, 100 Y over 5 seconds. -->
            <PointAnimation
             Storyboard.TargetProperty="Center"
             Storyboard.TargetName="MyAnimatedEllipseGeometry"
             Duration="0:0:5" 
             From="100,300"
             To="400,100"
             RepeatBehavior="Forever" />

        </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>



// Start the animation when the object loads
private void Start_Animation(object sender, EventArgs e)
{
    myStoryboard.Begin();
}


Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.