Events in .NET MAUI Linear ProgressBar (SfLinearProgressBar)

21 Jul 20262 minutes to read

ProgressChanged

This event is triggered when the progress value is changed. This event contains the following argument.

The following code sample demonstrates how to customize the color of a progress indicator based on progress using this event.

<progressBar:SfLinearProgressBar x:Name="linearProgressBar"
                                 ProgressChanged="OnProgressChanged"
                                 Progress="100" />
using Syncfusion.Maui.ProgressBar;

private void OnProgressChanged(object sender, ProgressValueEventArgs e)
{
    if (e.Progress < 50)
    {
        this.linearProgressBar.ProgressFill = Colors.Red;
    }
    else
    {
        this.linearProgressBar.ProgressFill = Colors.Green;
    }
}

ProgressCompleted

This event is triggered when the Progress reaches the Maximum value. This event contains the following argument.

The following code sample demonstrates how to customize the progress bar when the progress reaches the maximum using this event.

<progressBar:SfLinearProgressBar x:Name="linearProgressBar"
                                 ProgressCompleted="OnProgressCompleted"
                                 Progress="100" />
using Syncfusion.Maui.ProgressBar;

private void OnProgressCompleted(object sender, ProgressValueEventArgs e)
{
    this.linearProgressBar.ProgressFill = Colors.Green;
}

NOTE

Refer to our .NET MAUI Linear ProgressBar feature tour page for its groundbreaking feature representations. Also explore our .NET MAUI Linear ProgressBar example that shows how to configure a SfLinearProgressBar in .NET MAUI.