FadeAnimation

The FadeAnimation provides the ability to animate the opacity of a VisualElement from its original opacity to a specified new opacity and then back to the original.

Syntax

XAML

For use within XAML the FadeAnimation must be used in conjunction with the AnimationBehavior.

C#

The FadeAnimation can be used as follows in C#:

public async void Animate()
{
    var label = new Label();
    
    var fadeAnimation = new FadeAnimation();
    
    await fadeAnimation.Animate(label);
}

Examples

You can find an example of this animation in action in the .NET MAUI Community Toolkit Sample Application.

API

You can find the source code for FadeAnimation over on the .NET MAUI Community Toolkit GitHub repository.