This section provides a quick overview for working with the SfBusyIndicator for .NET MAUI. Walk through the entire process of creating a real world of this control.
- Create a new .NET MAUI application in Visual Studio.
- Syncfusion .NET MAUI components are available on nuget.org. To add SfBusyIndicator to your project, open the NuGet package manager in Visual Studio, search for Syncfusion.Maui.Core and then install it.
To use this control inside an application, you must register the handler for Syncfusion® core.
using Microsoft.Extensions.Logging;
using Syncfusion.Maui.Core.Hosting;
namespace BusyIndicatorGettingStarted
{
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureSyncfusionCore()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});
#if DEBUG
builder.Logging.AddDebug();
#endif
return builder.Build();
}
}
}
- Import the control namespace
Syncfusion.Maui.Core
in XAML or C# code. - Initialize the SfBusyIndicator control.
<ContentPage
. . .
xmlns:core="clr-namespace:Syncfusion.Maui.Core;assembly=Syncfusion.Maui.Core">
<core:SfBusyIndicator x:Name="busyIndicator"
IsRunning = "True" />
</ContentPage>
using Syncfusion.Maui.Core;
. . .
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
SfBusyIndicator busyIndicator = new SfBusyIndicator(){IsRunning = true};
Content = busyIndicator;
}
}
The .NET MAUI Busy Indicator provides some predefined animation types like Cupertino, LinearMaterial, and CircularMaterial. Users can select any one of the animation types using the AnimationType property.
<ContentPage.Content>
<core:SfBusyIndicator x:Name="busyIndicator"
IsRunning="True"
AnimationType="CircularMaterial" />
</ContentPage.Content>
Run the application to render the following output: