FadeOutThemeAnimation 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
代表預先設定好的不透明度動畫,當控件從介面中移除或隱藏時會套用。
public ref class FadeOutThemeAnimation sealed : Timeline
/// [Windows.Foundation.Metadata.Activatable(65536, "Microsoft.UI.Xaml.WinUIContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.WinUIContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class FadeOutThemeAnimation final : Timeline
[Windows.Foundation.Metadata.Activatable(65536, "Microsoft.UI.Xaml.WinUIContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.WinUIContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class FadeOutThemeAnimation : Timeline
Public NotInheritable Class FadeOutThemeAnimation
Inherits Timeline
<FadeOutThemeAnimation ... />
- 繼承
- 屬性
範例
以下範例將 FadeInThemeAnimation 和 FadeOutThemeAnimation 應用在一個矩形上。
<StackPanel>
<StackPanel.Resources>
<!-- Theme animations like this can use the default behavior like
this example or you could use properties like BeginTime and
Duration to tweak when and how quickly the animation occures.
If you want more control over a fade animation (e.g. just partial
fade), you will need to use DoubleAnimation to animate the Opacity
property of the element you want to fade in or out. -->
<Storyboard x:Name="EnterStoryboard">
<FadeOutThemeAnimation Storyboard.TargetName="myRectangle" />
</Storyboard>
<Storyboard x:Name="ExitStoryboard">
<FadeInThemeAnimation Storyboard.TargetName="myRectangle" />
</Storyboard>
</StackPanel.Resources>
<Rectangle x:Name="myRectangle"
PointerEntered="Rectangle_PointerEntered"
PointerExited="Rectangle_PointerExited"
Fill="Blue" Width="200" Height="300" />
</StackPanel>
// When the pointer enters the rectangle space, the animation begins.
private void Rectangle_PointerEntered(object sender, PointerRoutedEventArgs e)
{
EnterStoryboard.Begin();
}
private void Rectangle_PointerExited(object sender, PointerRoutedEventArgs e)
{
ExitStoryboard.Begin();
}
建構函式
| 名稱 | Description |
|---|---|
| FadeOutThemeAnimation() |
初始化一個新的 FadeOutThemeAnimation 類別實例。 |
屬性
| 名稱 | Description |
|---|---|
| AutoReverse |
取得或設定一個值,指示時間軸在完成正向迭代後是否會反向播放。 (繼承來源 Timeline) |
| BeginTime |
取得或設定此 時間軸 應開始的時間。 (繼承來源 Timeline) |
| Dispatcher |
它總是在 Windows 應用程式 SDK 應用程式中回傳 |
| DispatcherQueue |
得到 |
| Duration |
取得或設定此時間軸播放的時間長度,不計重複次數。 (繼承來源 Timeline) |
| FillBehavior |
取得或設定一個值,指定動畫在達到有效期間結束後的行為。 (繼承來源 Timeline) |
| RepeatBehavior |
他會觸發或設定這個時間線重複的行為。 (繼承來源 Timeline) |
| SpeedRatio |
取得或設定相對於父節點的速率,該 時間軸中時間的進展。 (繼承來源 Timeline) |
| TargetName |
取得或設定被鎖定控制元件的參考名稱。 |
| TargetNameProperty |
識別 TargetName 相依屬性。 |
方法
| 名稱 | Description |
|---|---|
| ClearValue(DependencyProperty) |
清除依賴性財產的局部價值。 (繼承來源 DependencyObject) |
| GetAnimationBaseValue(DependencyProperty) |
回傳任何為相依屬性建立的基礎值,適用於動畫未啟用時。 (繼承來源 DependencyObject) |
| GetValue(DependencyProperty) |
回傳 DependencyObject 中相依屬性的當前有效值。 (繼承來源 DependencyObject) |
| ReadLocalValue(DependencyProperty) |
若設定了本地值,則回傳依賴性質的局部值。 (繼承來源 DependencyObject) |
| RegisterPropertyChangedCallback(DependencyProperty, DependencyPropertyChangedCallback) |
註冊一個通知函式,用於監聽此 DependencyObject 實例中特定 DependencyProperty 的變更。 (繼承來源 DependencyObject) |
| SetValue(DependencyProperty, Object) |
將相依屬性的局部值設定在 DependencyObject 上。 (繼承來源 DependencyObject) |
| UnregisterPropertyChangedCallback(DependencyProperty, Int64) |
取消先前透過呼叫 RegisterPropertyChangedCallback 註冊的變更通知。 (繼承來源 DependencyObject) |
事件
| 名稱 | Description |
|---|---|
| Completed |
當 分鏡 物件完成播放時會發生。 (繼承來源 Timeline) |