This documentation is archived and is not being maintained.
SizeAnimationBase Class
Visual Studio 2008
Abstract class that, when implemented, animates a Size value.
Assembly: PresentationCore (in PresentationCore.dll)
Notes to Inheritors:
See the Custom Animations Overview for information about extending animation classes.
The following code example demonstrates how to use the derived SizeAnimationUsingKeyFrames class in Extensible Application Markup Language (XAML).
<!-- This example shows how to use the SizeAnimationUsingKeyFrames to animate the size of an ArcSegment. --> <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > <Canvas HorizontalAlignment="Left" Margin="0" > <!-- Create an arc on the screen that animates its size when it loads. --> <Path Stroke="Black" StrokeThickness="2" > <Path.Data> <PathGeometry> <PathGeometry.Figures> <PathFigureCollection> <PathFigure StartPoint="100,200"> <PathFigure.Segments> <PathSegmentCollection> <ArcSegment x:Name="myArcSegment" Size="90,80" SweepDirection="Clockwise" Point="500,200" /> </PathSegmentCollection> </PathFigure.Segments> </PathFigure> </PathFigureCollection> </PathGeometry.Figures> </PathGeometry> </Path.Data> <Path.Triggers> <EventTrigger RoutedEvent="Path.Loaded"> <BeginStoryboard Name="myBeginStoryBoard"> <Storyboard> <!-- Animating the Size property uses 3 KeyFrames. --> <SizeAnimationUsingKeyFrames Storyboard.TargetName="myArcSegment" Storyboard.TargetProperty="Size" > <SizeAnimationUsingKeyFrames.KeyFrames> <!-- Using a LinearSizeKeyFrame, the size of the arc increases gradually over the first half second of the animation. --> <LinearSizeKeyFrame KeyTime="0:0:0.5" Value="120,120" /> <!-- Using a DiscreteSizeKeyFrame, the size increases suddenly after the first second of the animation. --> <DiscreteSizeKeyFrame KeyTime="0:0:1" Value="150,150" /> <!-- Using a SplineSizeKeyFrame, the Size increases slowly at first and then speeds up exponentially. This KeyFrame takes 2 seconds. --> <SplineSizeKeyFrame KeySpline="0.6,0.0 0.9,0.00" KeyTime="0:0:3" Value="300,300" /> </SizeAnimationUsingKeyFrames.KeyFrames> </SizeAnimationUsingKeyFrames> </Storyboard> </BeginStoryboard> </EventTrigger> </Path.Triggers> </Path> </Canvas> </Page>
System.Object
System.Windows.Threading.DispatcherObject
System.Windows.DependencyObject
System.Windows.Freezable
System.Windows.Media.Animation.Animatable
System.Windows.Media.Animation.Timeline
System.Windows.Media.Animation.AnimationTimeline
System.Windows.Media.Animation.SizeAnimationBase
System.Windows.Media.Animation.SizeAnimation
System.Windows.Media.Animation.SizeAnimationUsingKeyFrames
System.Windows.Threading.DispatcherObject
System.Windows.DependencyObject
System.Windows.Freezable
System.Windows.Media.Animation.Animatable
System.Windows.Media.Animation.Timeline
System.Windows.Media.Animation.AnimationTimeline
System.Windows.Media.Animation.SizeAnimationBase
System.Windows.Media.Animation.SizeAnimation
System.Windows.Media.Animation.SizeAnimationUsingKeyFrames
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.
Show: