States in Xamarin ProgressBar (Progress Bar)

17 May 20211 minute to read

You can configure the states of the progress bar control depending on the usage.

Determinate

This is the default state. You can use it when the progress estimation is known.

Indeterminate

By enabling the IsIndeterminate property, the state of the progress bar can be changed to indeterminate when the progress cannot be estimated or is not being calculated. It can be combined with determinate mode to know that the application is estimating progress before the actual progress starts.

<!--Using linear progress bar-->

<progressBar:SfLinearProgressBar IsIndeterminate="True"/>

<!--Using circular progress bar-->

<progressBar:SfCircularProgressBar IsIndeterminate="True"/>
// Using linear progress bar. 

SfLinearProgressBar linearProgressBar = new SfLinearProgressBar { IsIndeterminate = true};

// Using circular progress bar.

SfCircularProgressBar circularProgressBar = new SfCircularProgressBar { IsIndeterminate = true };

Buffer

The secondary task’s progress can be defined using the SecondaryProgress property as demonstrated in the following code sample.

<progressBar:SfLinearProgressBar x:Name="LinearProgressBar" Progress="25" SecondaryProgress="75"/>
this.LinearProgressBar.Progress = 75;

this.LinearProgressBar.SecondaryProgress = 25;

Buffer