Share via


ViewExtensions.TranslateTo Method

Definition

Animates an elements TranslationX and TranslationY properties from their current values to the new values. This ensures that the input layout is in the same position as the visual layout.

public static System.Threading.Tasks.Task<bool> TranslateTo (this Microsoft.Maui.Controls.VisualElement view, double x, double y, uint length = 250, Microsoft.Maui.Easing? easing = default);
static member TranslateTo : Microsoft.Maui.Controls.VisualElement * double * double * uint32 * Microsoft.Maui.Easing -> System.Threading.Tasks.Task<bool>
<Extension()>
Public Function TranslateTo (view As VisualElement, x As Double, y As Double, Optional length As UInteger = 250, Optional easing As Easing = Nothing) As Task(Of Boolean)

Parameters

view
VisualElement

The view on which this method operates.

x
Double

The x component of the final translation vector.

y
Double

The y component of the final translation vector.

length
UInt32

The time, in milliseconds, over which to animate the transition. The default is 250.

easing
Easing

The easing function to use for the animation.

Returns

A Task containing a Boolean value which indicates whether the animation was canceled. true indicates that the animation was canceled. false indicates that the animation ran to completion.

Exceptions

Thrown when view is null.

Applies to