語言

CubicEase 類別

定義

代表一個緩和函數,利用公式 f (t) = t 3 產生加速和/或減速的動畫。

public ref class CubicEase sealed : EasingFunctionBase
/// [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 CubicEase final : EasingFunctionBase
[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 CubicEase : EasingFunctionBase
Public NotInheritable Class CubicEase
Inherits EasingFunctionBase
<CubicEase .../>
繼承
Object Platform::Object IInspectable DependencyObject EasingFunctionBase CubicEase
屬性

範例

這個 XAML 範例將 CubicEase 的緩和函數應用於 DoubleAnimation ,以產生減速動畫。

<StackPanel x:Name="LayoutRoot" >
    <StackPanel.Resources>
        <Storyboard x:Name="myStoryboard">
            <DoubleAnimation From="1" To="6" Duration="00:00:3" 
                Storyboard.TargetName="rectScaleTransform" 
                Storyboard.TargetProperty="ScaleY">
                <DoubleAnimation.EasingFunction>
                    <CubicEase EasingMode="EaseOut"/>
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
        </Storyboard>
    </StackPanel.Resources>

    <Rectangle PointerPressed="Pointer_Clicked" 
     Fill="Blue" Width="200" Height="30">
        <Rectangle.RenderTransform>
            <ScaleTransform x:Name="rectScaleTransform" />
        </Rectangle.RenderTransform>
    </Rectangle>

</StackPanel>
// When the user clicks the rectangle, the animation
// begins. 
private void Pointer_Clicked(object sender, PointerRoutedEventArgs e)
{
    myStoryboard.Begin();
}

備註

QuarticEase 的行為與 Power Ease 的 Power Ease 相同,且 Power Ease 的 Power Ease 為 3。 當 EasingMode 是 EaseIn (預設)時,這個緩和功能起初緩慢,大部分時間都相當緩慢,且在持續時間接近尾聲時加速迅速。

易解函數可以套用到FromTo/By動畫的/EasingFunction屬性,或用於關鍵影格動畫Ease變體的關鍵影格類型的EasingFunction屬性。 更多資訊請參見 關鍵影格動畫與輕鬆功能動畫。

建構函式

名稱 Description
CubicEase()

初始化一個新的 CubicEase 類別實例。

屬性

名稱 Description
Dispatcher

它總是在 Windows 應用程式 SDK 應用程式中回傳 null 。 改用 DispatcherQueue 。

(繼承來源 DependencyObject)
DispatcherQueue

得到 DispatcherQueue 這個物件所關聯的那個。 代表 DispatcherQueue 一個功能,即使程式碼是由非 UI 執行緒發起,也能存取 UI DependencyObject 執行緒。

(繼承來源 DependencyObject)
EasingMode

取得或設定一個值,指定動畫如何插值。

(繼承來源 EasingFunctionBase)

方法

名稱 Description
ClearValue(DependencyProperty)

清除依賴性財產的局部價值。

(繼承來源 DependencyObject)
Ease(Double)

將正規化時間轉換以控制動畫的節奏。

(繼承來源 EasingFunctionBase)
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)

適用於

另請參閱