ElasticEase.Springiness 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
用來調整彈簧的剛性。 彈簧度值越小,彈簧越剛,彈性在每次振盪過程中強度下降的速度越快。
public:
property double Springiness { double get(); void set(double value); };
public double Springiness { get; set; }
member this.Springiness : double with get, set
Public Property Springiness As Double
屬性值
一個正數,表示彈簧的剛度。 預設值是 3。
範例
以下範例將一個緩和函數應用 ElasticEase 於 a 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>
備註
數 Springiness 值越小,彈簧越剛,彈性在每次振盪時強度下降的速度也越快。
相依屬性識別碼欄位: SpringinessProperty
下圖說明不同值的 Springiness效果。
XAML 屬性使用方式
<ElasticEase Springiness="double"/>