BooleanAnimationBase 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
抽象類別,實作後會啟動一個 Boolean 值。
public ref class BooleanAnimationBase abstract : System::Windows::Media::Animation::AnimationTimeline
public abstract class BooleanAnimationBase : System.Windows.Media.Animation.AnimationTimeline
type BooleanAnimationBase = class
inherit AnimationTimeline
Public MustInherit Class BooleanAnimationBase
Inherits AnimationTimeline
- 繼承
-
BooleanAnimationBase
- 衍生
範例
以下程式碼範例示範如何使用可擴充應用程式標記語言(XAML)使用衍生 BooleanAnimationUsingKeyFrames 類別。
<!-- Demonstrates a BooleanAnimationUsingKeyFrames. The animation is used to
animate the IsEnabled property of a button. -->
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="Microsoft.Samples.KeyFrameAnimations.BooleanAnimationUsingKeyFramesExample"
Name="myRootElement"
WindowTitle="KeyFrameBoolean Animation Example">
<StackPanel Orientation="Vertical" Margin="20">
<TextBlock>
Click the button to animate the its IsEnabled property with a
BooleanAnimationUsingKeyFrames animation.
</TextBlock>
<Button Name="myAnimatedButton" Margin="200">Click Me
<Button.Triggers>
<EventTrigger RoutedEvent="Button.Click">
<BeginStoryboard>
<Storyboard>
<BooleanAnimationUsingKeyFrames
Storyboard.TargetName="myAnimatedButton" Storyboard.TargetProperty="(Button.IsEnabled)"
Duration="0:0:4" FillBehavior="HoldEnd">
<!-- All the key frames below are DiscreteBooleanKeyFrames. Discrete key frames create
sudden "jumps" between values (no interpolation). Only discrete key frames can be used
for Boolean key frame animations. -->
<DiscreteBooleanKeyFrame Value="False" KeyTime="0:0:0" />
<DiscreteBooleanKeyFrame Value="True" KeyTime="0:0:1" />
<DiscreteBooleanKeyFrame Value="False" KeyTime="0:0:2" />
<DiscreteBooleanKeyFrame Value="True" KeyTime="0:0:3" />
<DiscreteBooleanKeyFrame Value="False" KeyTime="0:0:3.5" />
<DiscreteBooleanKeyFrame Value="True" KeyTime="0:0:4" />
</BooleanAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Button.Triggers>
</Button>
</StackPanel>
</Page>
給實施者的注意事項
有關擴充動畫類別的資訊,請參閱 自訂動畫概覽 。
建構函式
| 名稱 | Description |
|---|---|
| BooleanAnimationBase() |
初始化 BooleanAnimationBase 類別的新執行個體。 |
屬性
| 名稱 | 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) |