共用方式為


ElasticEase.Oscillations 屬性

定義

取得或設定到達動畫目的期間,目標來回滑動的次數。

public:
 property int Oscillations { int get(); void set(int value); };
public int Oscillations { get; set; }
member this.Oscillations : int with get, set
Public Property Oscillations As Integer

屬性值

到達動畫目的期間,目標來回滑動的次數。 這個值必須大於或等於 0。 預設值為 3。

範例

下列範例會將 ElasticEase easing 函式套用至 , DoubleAnimation 以建立類似于回回震動的動畫,直到靜止為止。

<Rectangle Name="myRectangle" Width="200" Height="30" Fill="Blue">
    <Rectangle.Triggers>
        <EventTrigger RoutedEvent="Rectangle.MouseDown">
            <BeginStoryboard>
                <Storyboard>
                    <DoubleAnimation From="30" To="200" Duration="00:00:4" 
                     Storyboard.TargetName="myRectangle" 
                     Storyboard.TargetProperty="Height">
                        <DoubleAnimation.EasingFunction>
                            
                            <!-- Elastic easing function assigned to From/To animation -->
                            <ElasticEase x:Name="myElasticEase" Oscillations="3" 
                             Springiness="1" EasingMode="EaseOut"/>
                        </DoubleAnimation.EasingFunction>
                    </DoubleAnimation>

                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
    </Rectangle.Triggers>

</Rectangle>

備註

相依性屬性識別碼欄位: OscillationsProperty

XAML Attribute Usage

<ElasticEase Oscillations="int"/>  

適用於