Contents
- ProgressChanged
- ProgressCompleted
Having trouble getting help?
Contact Support
Contact Support
Events in .NET MAUI Linear ProgressBar (SfLinearProgressBar)
ProgressChanged
This event is triggered when the progress value is changed. This event contains the following event argument.
-
Progress:
Represents the progress value.
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="LinearProgressBar_ProgressChanged"
Progress="100" />
private void LinearProgressBar_ProgressChanged(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
attains the Maximum
value. This event contains the following argument.
-
Progress:
Represents the progress value.
The following code sample demonstrates how to customize the progress bar when the progress reaches maximum using this event.
<progressBar:SfLinearProgressBar x:Name="linearProgressBar"
ProgressCompleted="LinearProgressBar_ProgressCompleted"
Progress="100" />
private void LinearProgressBar_ProgressCompleted(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.