Back to Devexpress

DxProgressBar.Status Property

blazor-devexpress-dot-blazor-dot-dxprogressbar-5eae3aac.md

latest4.1 KB
Original Source

DxProgressBar.Status Property

Specifies the progress status that affects bar appearance, the icon, and the default label.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[DefaultValue(ProgressBarStatus.InProgress)]
[Parameter]
public ProgressBarStatus Status { get; set; }

Property Value

TypeDefaultDescription
ProgressBarStatusInProgress

The progress bar status.

|

Available values:

NameDescriptionImage
InProgress

The default status. The progress bar displays the extending bar indicator and the percentage progress value.

|

| | Success |

The progress bar displays a fully colored bar indicator and the Success label. If the Status property is not specified, the component automatically sets the Success status when the Value reaches the MaxValue. You can set the SetSuccessStatusOnComplete property to false to disable this behavior and set the status manually when the task is completed (in the Completed event handler).

|

| | Pause |

The progress bar displays a bar indicator at the current progress position and a Pause label. Set this status to notify your users that there is a delay in task progress.

|

| | Error |

The progress bar displays a fully colored bar indicator and the Error label. Set this status to notify your users that there is an error in task progress.

|

|

Remarks

The progress bar status affects bar appearance, the icon, and default label (when the Label property is not specified).

If the Status property is not specified, the component automatically sets the Success status when the Value reaches the MaxValue. You can set the SetSuccessStatusOnComplete property to false to disable this behavior.

razor
<DxProgressBar Value="value" ShowIcon="true" Status="status" />

@code {
    ProgressBarStatus status;
    int value = 0;
    bool running;

    private void RunProgress() {
        if (running) return;
        running = true;
        InvokeAsync(async () => {
            while (running && value < 100) {
                await Task.Delay(25);
                value++;
                StateHasChanged();
                // Set status to Pause for 1,5 seconds for demonstration purposes.
                if (value == 30) {
                    await Task.Delay(500);
                    status = ProgressBarStatus.Pause;
                    StateHasChanged();
                    await Task.Delay(1500);
                    status = ProgressBarStatus.InProgress;
                }
            }
            // Set status to Success when value reaches the maximum value (100%).
            status = ProgressBarStatus.Success;
            StateHasChanged();
            running = false;
        });
    }
}

See Also

DxProgressBar Class

DxProgressBar Members

DevExpress.Blazor Namespace