英語で読む

次の方法で共有


DoubleAnimation.EasingFunction プロパティ

定義

このアニメーションに適用されているイージング機能を取得または設定します。

public EasingFunctionBase EasingFunction { get; set; }
<DoubleAnimation>
  <DoubleAnimation.EasingFunction>
    singleEasingFunction
  </DoubleAnimation.EasingFunction>
</DoubleAnimation>

プロパティ値

このアニメーションに適用されているイージング機能。

この XAML の例では、 BounceEase イージング関数を DoubleAnimation に適用して、バウンス効果を作成します。

<StackPanel x:Name="LayoutRoot" Background="White">
    <StackPanel.Resources>
        <Storyboard x:Name="myStoryboard">
            <DoubleAnimation From="30" To="200" Duration="00:00:3" 
                Storyboard.TargetName="ball" 
                Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)">
                <DoubleAnimation.EasingFunction>
                    <BounceEase Bounces="4" EasingMode="EaseOut" 
                                Bounciness="1.8" />
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
        </Storyboard>
    </StackPanel.Resources>

    <Ellipse x:Name="ball" MouseLeftButtonDown="Clicked" 
     Fill="Blue" Width="100" Height="100">
      <Ellipse.RenderTransform>
        <TranslateTransform/>
      <Ellipse.RenderTransform>
    <Ellipse
</StackPanel>
// When the user clicks the object, the animation begins. 
private void Clicked(object sender, PointerRoutedEventArgs e)
{
    myStoryboard.Begin();
}

注釈

イージング関数を使うと、独自の数式をアニメーションに適用することができます。 数学演算は、2-D の座標系で実際の物理法則をシミュレートするアニメーションを作るうえで役立ちます。 たとえば、オブジェクトをリアルにバウンドさせたり、バネに乗っているように動作させたりすることができます。 イージング関数の一覧と使用方法の情報については、「 キー フレーム アニメーションとイージング関数アニメーション」を参照してください。

適用対象

製品 バージョン
Windows App SDK 0.8, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6

こちらもご覧ください