BackEase BackEase BackEase BackEase Class

Definition

Represents an easing function that changes a value in the opposite direction of the main function during part of a duration, then reverses and finishes the function-over-time behavior in a conventional way.

public : sealed class BackEase : EasingFunctionBase, IBackEase
struct winrt::Windows::UI::Xaml::Media::Animation::BackEase : EasingFunctionBase, IBackEase
public sealed class BackEase : EasingFunctionBase, IBackEase
Public NotInheritable Class BackEase Inherits EasingFunctionBase Implements IBackEase
<BackEase .../>
Inheritance
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Examples

The following example applies a BackEase easing function to a DoubleAnimation to create an animation that retracts slightly at the beginning and end of the animation.

<StackPanel x:Name="LayoutRoot" >
    <StackPanel.Resources>
        <Storyboard x:Name="myStoryboard">
                <DoubleAnimation From="1" To="2" Duration="00:00:1" 
                Storyboard.TargetName="myScaleTransform" 
                Storyboard.TargetProperty="ScaleX">
                <DoubleAnimation.EasingFunction>
                    <BackEase Amplitude="0.3" EasingMode="EaseInOut" />
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
        </Storyboard>
    </StackPanel.Resources>

    <Rectangle Margin="60" x:Name="myRectangle" PointerPressed="Pointer_Clicked" 
     Fill="Blue" Width="50" Height="50" >
        
        <Rectangle.RenderTransform>
            <ScaleTransform x:Name="myScaleTransform" />
        </Rectangle.RenderTransform>
        
    </Rectangle>
</StackPanel>
// When the user clicks the rectangle, the animation
// begins. 
private void Pointer_Clicked(object sender, PointerRoutedEventArgs e)
{
    myStoryboard.Begin();
}
' When the user clicks the rectangle, the animation
' begins. 
Private Sub Pointer_Clicked(ByVal sender As Object, ByVal e As PointerRoutedEventArgs)
    myStoryboard.Begin()
End Sub

Remarks

BackEase is one of the two easing functions that can produce a value outside of the normal From/To range. (The other is ElasticEase.)

  • If EasingMode is EaseIn (the default) then the function starts by changing the value in the opposite direction of the value change that From and To indicate, in other words it initially produces a value that's less than the From value.
  • If EasingMode is EaseOut then the function starts in a typical way, but near the end will exceed the To value and then come back to the To value at the end.
  • If EasingMode is EaseInOut then the function gives values that are less than From at the beginning and greater than To near the end. This illustration shows a function-over-time graph approximation for a BackEase for each of the three possible EasingMode values, with Amplitude as its default value.Illustration of function-over-time graph for the BackEase easing function. The graph shows curves where the x axis is time t and the y axis is function-over-time f(t)

You might get best results by just experimenting with the Springiness and EasingMode properties until the animation is visually doing what you want for your animated property value scenario.

An easing function can be applied to the EasingFunction properties of From/To/By animations, or to the EasingFunction properties of key-frame types used for the Easing variants of key-frame animations. For more info, see Key-frame animations and easing function animations.

Constructors

BackEase() BackEase() BackEase() BackEase()

Initializes a new instance of the BackEase class.

public : BackEase()
BackEase() const;
public BackEase()
Public Sub New()

Properties

Amplitude Amplitude Amplitude Amplitude

Gets or sets the amplitude of retraction associated with a BackEase animation.

public : double Amplitude { get; set; }
double Amplitude(); void Amplitude(double amplitude);
public double Amplitude { get; set; }
Public ReadWrite Property Amplitude As double
<BackEase Amplitude="double" .../>

Value
double double

The amplitude of retraction associated with a BackEase animation. This value must be greater than or equal to 0. The default is 1.

Examples

The following example applies a BackEase easing function to a DoubleAnimation to create an animation that retracts slightly at the beginning and end of the animation.

<StackPanel x:Name="LayoutRoot" >
    <StackPanel.Resources>
        <Storyboard x:Name="myStoryboard">
                <DoubleAnimation From="1" To="2" Duration="00:00:1" 
                Storyboard.TargetName="myScaleTransform" 
                Storyboard.TargetProperty="ScaleX">
                <DoubleAnimation.EasingFunction>
                    <BackEase Amplitude="0.3" EasingMode="EaseInOut" />
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
        </Storyboard>
    </StackPanel.Resources>

    <Rectangle Margin="60" x:Name="myRectangle" PointerPressed="Pointer_Clicked" 
     Fill="Blue" Width="50" Height="50" >
        
        <Rectangle.RenderTransform>
            <ScaleTransform x:Name="myScaleTransform" />
        </Rectangle.RenderTransform>
        
    </Rectangle>
</StackPanel>
// When the user clicks the rectangle, the animation
// begins. 
private void Pointer_Clicked(object sender, PointerRoutedEventArgs e)
{
    myStoryboard.Begin();
}
' When the user clicks the rectangle, the animation
' begins. 
Private Sub Pointer_Clicked(ByVal sender As Object, ByVal e As PointerRoutedEventArgs)
    myStoryboard.Begin()
End Sub

AmplitudeProperty AmplitudeProperty AmplitudeProperty AmplitudeProperty

Identifies the Amplitude dependency property.

public : static DependencyProperty AmplitudeProperty { get; }
static DependencyProperty AmplitudeProperty();
public static DependencyProperty AmplitudeProperty { get; }
Public Static ReadOnly Property AmplitudeProperty As DependencyProperty
Value
DependencyProperty DependencyProperty

The identifier for the Amplitude dependency property.

Dispatcher Dispatcher Dispatcher Dispatcher

Gets the CoreDispatcher that this object is associated with. The CoreDispatcher represents a facility that can access the DependencyObject on the UI thread even if the code is initiated by a non-UI thread.

(Inherited from DependencyObject)

EasingMode EasingMode EasingMode EasingMode

Gets or sets a value that specifies how the animation interpolates.

(Inherited from EasingFunctionBase)

EasingModeProperty EasingModeProperty EasingModeProperty EasingModeProperty

Identifies the EasingMode dependency property.

(Inherited from EasingFunctionBase)

Methods

ClearValue(DependencyProperty) ClearValue(DependencyProperty) ClearValue(DependencyProperty) ClearValue(DependencyProperty)

Clears the local value of a dependency property.

(Inherited from DependencyObject)

Ease(Double) Ease(Double) Ease(Double) Ease(Double)

Transforms normalized time to control the pace of an animation.

(Inherited from EasingFunctionBase)

GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty)

Returns any base value established for a dependency property, which would apply in cases where an animation is not active.

(Inherited from DependencyObject)

GetValue(DependencyProperty) GetValue(DependencyProperty) GetValue(DependencyProperty) GetValue(DependencyProperty)

Returns the current effective value of a dependency property from a DependencyObject.

(Inherited from DependencyObject)

ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty)

Returns the local value of a dependency property, if a local value is set.

(Inherited from DependencyObject)

RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback)

Registers a notification function for listening to changes to a specific DependencyProperty on this DependencyObject instance.

(Inherited from DependencyObject)

SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object)

Sets the local value of a dependency property on a DependencyObject.

(Inherited from DependencyObject)

UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64)

Cancels a change notification that was previously registered by calling RegisterPropertyChangedCallback.

(Inherited from DependencyObject)

See Also