Advertisement
Intermediate .NET MAUI, Gestures & Animations

How do you run basic animations in MAUI?

Short answer

Use the ViewExtensions async animation methods—FadeTo, TranslateTo, ScaleTo, RotateTo, ColorTo—which return Tasks you can await or combine with Task.WhenAll. Specify duration and an Easing function. Cancel with this.AbortAnimation when needed.

Save .NET MAUI mock interview
Advertisement
AModel answer
Use the ViewExtensions async animation methods—FadeTo, TranslateTo, ScaleTo, RotateTo, ColorTo—which return Tasks you can await or combine with Task.WhenAll. Specify duration and an Easing function. Cancel with this.AbortAnimation when needed.
await Task.WhenAll(
    logo.FadeTo(1, 500),
    logo.ScaleTo(1.2, 500, Easing.CubicOut));
Real-world example
A splash logo fades in while scaling up slightly, using two awaited animations run together.
Likely follow-ups
  • How do you run animations in parallel? | What is Easing?
Related topics