Events in .NET MAUI Circular ProgressBar (SfCircularProgressBar)

ProgressChanged

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

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

<progressBar:SfCircularProgressBar x:Name="circularProgressBar" 
                                   ProgressChanged="CircularProgressBar_ProgressChanged"
                                   Progress="100" />
private void CircularProgressBar_ProgressChanged(object sender, ProgressValueEventArgs e)
{
    if (e.Progress < 50)
    {
        this.circularProgressBar.ProgressFill = Colors.Red;
    }
    else
    {
        this.circularProgressBar.ProgressFill = Colors.Green;
    }
}

ProgressCompleted

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

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

<progressBar:SfCircularProgressBar Minimum="100" 
                                   Maximum="500" 
                                   ProgressCompleted="CircularProgressBar_ProgressCompleted" 
                                   Progress="500">
    <progressBar:SfCircularProgressBar.Content>
        <Grid WidthRequest="150">
            <Label x:Name="Label" 
                   Text="Start" 
                   FontSize="15"
                   HorizontalTextAlignment="Center" 
                   VerticalTextAlignment="Center" />
        </Grid>
    </progressBar:SfCircularProgressBar.Content>
</progressBar:SfCircularProgressBar>
private void CircularProgressBar_ProgressCompleted(object sender, ProgressValueEventArgs e)
{
    this.Label.Text = "Completed";
}

NOTE

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