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>
給實施者的注意事項
有關擴充動畫類別的資訊,請參閱 自訂動畫概覽 。
建構函式
| 名稱 | Description |
|---|---|
| MatrixAnimationBase() |
初始化 MatrixAnimationBase 類別的新執行個體。 |
屬性
| 名稱 | Description |
|---|---|
| AccelerationRatio |
取得或設定一個值,指定時間軸 Duration 中加速時間從零到最大速率的百分比。 (繼承來源 Timeline) |
| AutoReverse |
取得或設定一個值,指示時間軸在完成正向迭代後是否會反向播放。 (繼承來源 Timeline) |
| BeginTime |
設定或設定這件事 Timeline 應該開始的時間。 (繼承來源 Timeline) |
| CanFreeze |
會得到一個值,表示該物件是否能被設定為不可修改。 (繼承來源 Freezable) |
| DecelerationRatio |
會取得或設定一個值,指定時間軸 Duration 中將時間流逝從最大速度減速到零的百分比。 (繼承來源 Timeline) |
| DependencyObjectType |
會取得 DependencyObjectType 包裹此實例 CLR 類型的 。 (繼承來源 DependencyObject) |
| Dispatcher |
了解 Dispatcher 這與此 DispatcherObject 有關。 (繼承來源 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 |
能獲得這個動畫所產生的價值類型。 |
方法
事件
| 名稱 | Description |
|---|---|
| Changed |
當 Freezable 它所包含的物件被修改時,會發生這種情況。 (繼承來源 Freezable) |
| Completed |
當這條時間線完全結束播放時,會發生:它將不再進入其有效期間。 (繼承來源 Timeline) |
| CurrentGlobalSpeedInvalidated |
當時間軸時鐘的變化速率改變時,會發生這種情況。 (繼承來源 Timeline) |
| CurrentStateInvalidated |
當 CurrentState 時間軸 Clock 的屬性更新時會發生。 (繼承來源 Timeline) |
| CurrentTimeInvalidated |
當 CurrentTime 時間軸 Clock 的屬性更新時會發生。 (繼承來源 Timeline) |
| RemoveRequested |
當為此時間線或其父時間線所建立的時鐘被移除時,會發生這種情況。 (繼承來源 Timeline) |