Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

PointAnimationBase Class

Abstract class that, when implemented, animates a Point value.

Namespace:  System.Windows.Media.Animation
Assembly:  PresentationCore (in PresentationCore.dll)
public abstract class PointAnimationBase : AnimationTimeline
This class is abstract; see Inheritance Hierarchy for derived non-abstract classes usable in XAML.

Notes to Inheritors:

See the Custom Animations Overview for information about extending animation classes.

The following code example demonstrates how to use the derived PointAnimationUsingKeyFrames class in Extensible Application Markup Language (XAML).

<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
    <Canvas>
      <Path Fill="Blue" Margin="15,15,15,15">
        <Path.Data>

          <!-- Describes an ellipse. -->
          <EllipseGeometry x:Name="MyAnimatedEllipseGeometry"
            Center="200,100" RadiusX="15" RadiusY="15" />
        </Path.Data>
        <Path.Triggers>
          <EventTrigger RoutedEvent="Path.Loaded">
            <BeginStoryboard Name="MyBeginStoryboard">
              <Storyboard>

                <!-- 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" FillBehavior="HoldEnd" RepeatBehavior="Forever">
                  <PointAnimationUsingKeyFrames.KeyFrames>

                    <!-- 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">
                      <LinearPointKeyFrame.Value>
                        <Point X="100" Y="300" />
                      </LinearPointKeyFrame.Value>
                    </LinearPointKeyFrame>

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

                    <!-- 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">
                      <SplinePointKeyFrame.Value>
                        <Point X="200" Y="100" />
                      </SplinePointKeyFrame.Value>
                    </SplinePointKeyFrame>
                  </PointAnimationUsingKeyFrames.KeyFrames>
                </PointAnimationUsingKeyFrames>
              </Storyboard>
            </BeginStoryboard>
          </EventTrigger>
        </Path.Triggers>
      </Path>
    </Canvas>
</Page>
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.