MatrixAnimationBase 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
实现时对值进行动画处理的 Matrix 抽象类。
public ref class MatrixAnimationBase abstract : System::Windows::Media::Animation::AnimationTimeline
public abstract class MatrixAnimationBase : System.Windows.Media.Animation.AnimationTimeline
type MatrixAnimationBase = class
inherit AnimationTimeline
Public MustInherit Class MatrixAnimationBase
Inherits AnimationTimeline
- 继承
-
MatrixAnimationBase
- 派生
示例
下面的代码示例演示如何在可扩展应用程序标记语言(XAML)中使用派生 MatrixAnimationUsingKeyFrames 类。
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="Microsoft.Samples.KeyFrameAnimations.MatrixAnimationUsingKeyFramesExample"
WindowTitle="MatrixAnimationUsingPath Example">
<StackPanel Margin="20">
<Canvas HorizontalAlignment="Left" Width="340" Height="240" >
<!-- The Button that is animated. -->
<Button Margin="-30,0,0,0" MinWidth="100">
Click
<Button.RenderTransform>
<MatrixTransform x:Name="myMatrixTransform">
<MatrixTransform.Matrix >
<Matrix OffsetX="10" OffsetY="100"/>
</MatrixTransform.Matrix>
</MatrixTransform>
</Button.RenderTransform>
<Button.Triggers>
<EventTrigger RoutedEvent="Button.Loaded">
<BeginStoryboard>
<Storyboard>
<!-- Animates the button's MatrixTransform using MatrixAnimationUsingKeyFrames.
Animates to first Matrix in the first 0.2 seconds, to second Matrix in the next
second, and then starts over. Notice that the first KeyFrame stretches the button
and skews it using the M11 and M12 Matrix properties respectively. Also, animations are
using Discrete interpolation, so the MatrixTransform appears to "jump" from one value
to the next. -->
<MatrixAnimationUsingKeyFrames
Storyboard.TargetName="myMatrixTransform"
Storyboard.TargetProperty="Matrix"
Duration="0:0:3"
RepeatBehavior="Forever">
<DiscreteMatrixKeyFrame KeyTime="0:0:0.2">
<DiscreteMatrixKeyFrame.Value>
<Matrix OffsetX="100" OffsetY="200" M11="3" M12="1" />
</DiscreteMatrixKeyFrame.Value>
</DiscreteMatrixKeyFrame>
<DiscreteMatrixKeyFrame KeyTime="0:0:1">
<DiscreteMatrixKeyFrame.Value>
<Matrix OffsetX="300" OffsetY="100" M11="1" M12="0" />
</DiscreteMatrixKeyFrame.Value>
</DiscreteMatrixKeyFrame>
</MatrixAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Button.Triggers>
</Button>
</Canvas>
</StackPanel>
</Page>
实施者说明
有关扩展动画类的信息,请参阅 自定义动画概述 。
构造函数
| 名称 | 说明 |
|---|---|
| MatrixAnimationBase() |
初始化 MatrixAnimationBase 类的新实例。 |
属性
| 名称 | 说明 |
|---|---|
| AccelerationRatio |
获取或设置一个值,该值指定时间线 Duration 的花费百分比将时间从零加速到其最大速率。 (继承自 Timeline) |
| AutoReverse |
获取或设置一个值,该值指示时间线在完成向前迭代后是否反向播放。 (继承自 Timeline) |
| BeginTime |
获取或设置此时 Timeline 应开始的时间。 (继承自 Timeline) |
| CanFreeze |
获取一个值,该值指示是否可以使对象不可修改。 (继承自 Freezable) |
| DecelerationRatio |
获取或设置一个值,该值指定时间线 Duration 的花费百分比将时间从最大速率减至零。 (继承自 Timeline) |
| DependencyObjectType |
获取包装 DependencyObjectType 此实例的 CLR 类型。 (继承自 DependencyObject) |
| Dispatcher |
获取与此DispatcherDispatcherObject关联的值。 (继承自 DispatcherObject) |
| Duration |
获取或设置此时间线播放的时间长度,而不是计数重复。 (继承自 Timeline) |
| FillBehavior |
获取或设置一个值,该值指定其活动期结束时的行为方式 Timeline 。 (继承自 Timeline) |
| HasAnimatedProperties |
获取一个值,该值指示一个或多个 AnimationClock 对象是否与此对象的依赖属性中的任何一个相关联。 (继承自 Animatable) |
| IsDestinationDefault |
获取一个值,该值指示此动画是否使用方法的 GetCurrentValue(Object, Object, AnimationClock) 参数作为其目标值。 (继承自 AnimationTimeline) |
| IsFrozen |
获取一个值,该值指示对象当前是否可修改。 (继承自 Freezable) |
| IsSealed |
获取一个值,该值指示此实例当前是否密封(只读)。 (继承自 DependencyObject) |
| Name |
获取或设置此 Timeline名称。 (继承自 Timeline) |
| RepeatBehavior |
获取或设置此时间线的重复行为。 (继承自 Timeline) |
| SpeedRatio |
获取或设置相对于其父级的速率,此时会进行此 Timeline进程。 (继承自 Timeline) |
| TargetPropertyType |
获取此动画生成的值的类型。 |
方法
事件
| 名称 | 说明 |
|---|---|
| Changed |
修改它包含的对象时 Freezable 发生。 (继承自 Freezable) |
| Completed |
当此时间线完全完成播放时发生:它将不再进入其活动期。 (继承自 Timeline) |
| CurrentGlobalSpeedInvalidated |
在时间线时钟发生更改的速率时发生。 (继承自 Timeline) |
| CurrentStateInvalidated |
更新 CurrentState 时间线 Clock 的属性时发生。 (继承自 Timeline) |
| CurrentTimeInvalidated |
更新 CurrentTime 时间线 Clock 的属性时发生。 (继承自 Timeline) |
| RemoveRequested |
在删除为此时间线或其父时间线之一创建的时钟时发生。 (继承自 Timeline) |