Skip to content

ProgressExtensions

Namespace: Hex1b

Assembly: Hex1b.dll

Extension methods for creating Progress widgets.

csharp
public static class ProgressExtensions

Inheritance

ObjectProgressExtensions

Methods

Progress<TParent>(WidgetContext<TParent>, double, double, double)

Creates a determinate progress bar with a custom range.

Parameters:

  • ctx (WidgetContext<<TParent>>): The widget context.
  • current (Double): The current progress value.
  • min (Double): The minimum value of the range.
  • max (Double): The maximum value of the range.

Returns: ProgressWidget

A new ProgressWidget configured for determinate mode with a custom range.

csharp
public static ProgressWidget Progress<TParent>(this WidgetContext<TParent> ctx, double current, double min, double max) where TParent : Hex1bWidget

Progress<TParent>(WidgetContext<TParent>, double)

Creates a determinate progress bar with a value from 0 to 100.

Parameters:

  • ctx (WidgetContext<<TParent>>): The widget context.
  • current (Double): The current progress value (0-100 by default).

Returns: ProgressWidget

A new ProgressWidget configured for determinate mode.

csharp
public static ProgressWidget Progress<TParent>(this WidgetContext<TParent> ctx, double current) where TParent : Hex1bWidget

ProgressIndeterminate<TParent>(WidgetContext<TParent>)

Creates an indeterminate progress bar for operations with unknown completion.

Parameters:

  • ctx (WidgetContext<<TParent>>): The widget context.

Returns: ProgressWidget

A new ProgressWidget configured for indeterminate mode with automatic animation.

csharp
public static ProgressWidget ProgressIndeterminate<TParent>(this WidgetContext<TParent> ctx) where TParent : Hex1bWidget

Remarks

Progress widgets come in two variants:

Determinate: Use when you know the completion amount.

Indeterminate: Use when completion is unknown. Animation is automatic and time-based.

Examples

Determinate progress (0-100):

csharp
ctx.VStack(v => [
    v.Text("Downloading..."),
    v.Progress(percentComplete)
])

Custom range:

csharp
ctx.Progress(current: bytesDownloaded, min: 0, max: totalBytes)

Indeterminate (self-animating):

csharp
ctx.ProgressIndeterminate()

Released under the MIT License.