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.
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
.NET MAUI Community Toolkit