Export (0) Print
Expand All

PointAnimationBase Class

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

Namespace: System.Windows.Media.Animation
Assembly: PresentationCore (in presentationcore.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public abstract class PointAnimationBase : AnimationTimeline
public abstract class PointAnimationBase extends AnimationTimeline
public abstract class PointAnimationBase extends 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 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2014 Microsoft