ElasticEase.Springiness Property
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Gets or sets the stiffness of the spring. The smaller the Springiness value is, the stiffer the spring and the faster the elasticity decreases in intensity over each oscillation.
Namespace: System.Windows.Media.Animation
Assembly: System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.
Syntax
Public Property Springiness As Double
public double Springiness { get; set; }
<ElasticEase Springiness="double"/>
Property Value
Type: System..::.Double
A positive number that specifies the stiffness of the spring. The default value is 3.
Remarks
Dependency property identifier field: SpringinessProperty
The smaller the Springiness value is, the stiffer the spring and the faster the elasticity decreases in intensity over each oscillation.
The following diagram illustrates the effect of different values of Springiness.
.png)
Examples
The following example applies an ElasticEase easing function to a DoubleAnimation to create an animation that resembles a spring oscillating back and forth until it comes to rest.
<StackPanel x:Name="LayoutRoot" Background="Transparent">
<StackPanel.Resources>
<Storyboard x:Name="myStoryboard">
<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>
</StackPanel.Resources>
<Rectangle x:Name="myRectangle" MouseLeftButtonDown="Mouse_Clicked"
Fill="Blue" Width="200" Height="30" />
</StackPanel>
' When the user clicks the rectangle, the animation
' begins.
Private Sub Mouse_Clicked(ByVal sender As Object, ByVal e As MouseEventArgs)
myStoryboard.Begin()
End Sub
// When the user clicks the rectangle, the animation
// begins.
private void Mouse_Clicked(object sender, MouseEventArgs e)
{
myStoryboard.Begin();
}
Version Information
Windows Phone OS
Supported in: 8.1, 8.0, 7.1, 7.0
Platforms
Windows Phone