Skip to content

ProgressWidget

Namespace: Hex1b.Widgets

Assembly: Hex1b.dll

Displays a progress bar that can show either determinate (known completion percentage) or indeterminate (unknown completion) progress.

csharp
public sealed record ProgressWidget : Hex1bWidget, IEquatable<Hex1bWidget>, IEquatable<ProgressWidget>

Inheritance

ObjectHex1bWidgetProgressWidget

Implements

Constructors

ProgressWidget()

Creates a new determinate progress widget.

csharp
public ProgressWidget()

Properties

IsIndeterminate

Gets a value indicating whether the progress bar is in indeterminate mode.

Returns: Boolean

csharp
public bool IsIndeterminate { get; init; }

Maximum

Gets the maximum value of the progress range.

Returns: Double

csharp
public double Maximum { get; init; }

Minimum

Gets the minimum value of the progress range.

Returns: Double

csharp
public double Minimum { get; init; }

Value

Gets the current value of the progress bar.

Returns: Double

csharp
public double Value { get; init; }

Fields

DefaultAnimationInterval

Default animation interval for indeterminate progress bars.

Returns: TimeSpan

csharp
public static readonly TimeSpan DefaultAnimationInterval

Remarks

The progress widget has two modes:

Determinate: Shows progress as a filled bar from to . The current value is set via . Values can be any range, not just 0-100.

Indeterminate: Shows an animated indicator when the completion amount is unknown. Set to true for this mode. Animation is time-based and automatic.

By default, the progress bar fills the available horizontal space. Use layout extensions like FixedWidth() to constrain its size.

Examples

Determinate progress (0-100%):

csharp
ctx.Progress(current: 75)

Custom range (e.g., bytes downloaded):

csharp
ctx.Progress(current: 1500, min: 0, max: 5000)

Indeterminate progress (self-animating):

csharp
ctx.ProgressIndeterminate()

Released under the MIT License.