Stepper
Namespace: Wisej.Web
Assembly: Wisej.Framework (4.2.0.0)
Displays a wizard header or process tracker with observable steps and validated navigation.
- C#
- VB.NET
public class Stepper : Control
Public Class Stepper
Inherits Control
ActiveIndex overlays the active visual state without erasing stored Step.State values. Navigation through Next, Previous, or a step click raises Validating. Direct ActiveIndex assignment bypasses navigation validation and Linear restrictions, for application-controlled state restoration.
Example:
var stepper = new Stepper { Appearance = StepperAppearance.Numbers, AllowStepClick = true };
stepper.Steps.Add(new Step { Text = "Account", Description = "Company and contacts" });
stepper.Steps.Add(new Step { Text = "Review", Description = "Sign and submit" });
stepper.ActiveIndex = 0;
stepper.Validating += (sender, e) => e.Cancel = e.Step?.State == StepState.Error;
this.Controls.Add(stepper);
Constructors
Stepper()
Initializes an empty horizontal stepper with linear navigation.
Properties
ActiveIndex
Int32: Gets or sets the selected step index, or -1 for no selection. (Default: -1)
Direct assignment bypasses Validating and Linear. The selected step is preserved by identity when steps are inserted or removed before it; removing the selection resets the index to -1.
ActiveText
String: Gets or sets the localized override for the "active" text. (Default: null)
The default is null, which selects the built-in translation for the current UI culture. The getter returns the configured override. An empty string suppresses the text without changing the operation.
AllowStepClick
Boolean: Gets or sets whether step headers can be activated with pointer or keyboard. (Default: False)
Appearance
StepperAppearance: Gets or sets the marker presentation. AppearanceKey still selects the theme appearance. (Default: Numbers)
CompletedText
String: Gets or sets the localized override for the "Completed" text. (Default: null)
The default is null, which selects the built-in translation for the current UI culture. The getter returns the configured override. An empty string suppresses the text without changing the operation.
DefaultSize
Size: Gets the default stepper size.
ErrorText
String: Gets or sets the localized override for the "error" text. (Default: null)
The default is null, which selects the built-in translation for the current UI culture. The getter returns the configured override. An empty string suppresses the text without changing the operation.
Focusable
Boolean: Gets or sets whether the stepper can receive the focus. The default is false. (Default: False)
Linear
Boolean: Gets or sets whether forward navigation must visit incomplete required steps in order. (Default: True)
OptionalText
String: Gets or sets the localized override for the "optional" text. (Default: null)
The default is null, which selects the built-in translation for the current UI culture. The getter returns the configured override. An empty string suppresses the text without changing the operation.
Orientation
Orientation: Gets or sets the arrangement of steps. (Default: Horizontal)
PendingText
String: Gets or sets the localized override for the "pending" text. (Default: null)
The default is null, which selects the built-in translation for the current UI culture. The getter returns the configured override. An empty string suppresses the text without changing the operation.
SkippedText
String: Gets or sets the localized override for the "skipped" text. (Default: null)
The default is null, which selects the built-in translation for the current UI culture. The getter returns the configured override. An empty string suppresses the text without changing the operation.
Steps
StepCollection: Gets the ordered steps. Item edits update the client automatically.
TabStop
Boolean: Gets or sets whether the stepper takes part in tab navigation. The default is false. (Default: False)
Methods
Dispose(disposing)
Releases collection observers.
| Parameter | Type | Description |
|---|---|---|
| disposing | Boolean | True when managed resources may be released. |
Next()
Validates and selects the next step, starting at zero when nothing is selected.
Returns: Boolean. True when selection changed; false at the end, when disabled, or when validation canceled.
A successfully departed Pending or Active step becomes Completed. Error and Skipped states are retained. The last step is not completed automatically because there is no next step.
OnActiveIndexChanged(e)
Raises ActiveIndexChanged.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | Event data. |
OnStepClick(e)
Raises StepClick.
| Parameter | Type | Description |
|---|---|---|
| e | StepEventArgs | Clicked step information. |
OnValidating(e)
Raises navigation Validating independently of inherited focus validation.
| Parameter | Type | Description |
|---|---|---|
| e | StepCancelEventArgs | The proposed move and cancellation flag. |
OnWebEvent(e)
Dispatches browser events to their processing methods.
| Parameter | Type | Description |
|---|---|---|
| e | WisejEventArgs | Client event. |
OnWebRender(config)
Serializes the current versioned step snapshot and always wires normal events.
| Parameter | Type | Description |
|---|---|---|
| config | Object | Client configuration. |
Previous()
Validates and selects the previous step without changing completion states.
Returns: Boolean. True when selection changed; false at the beginning or when validation canceled.
Events
ActiveIndexChanged
EventHandler Occurs after the active index changes, including changes caused by collection edits.
StepClick
EventHandler<StepEventArgs> Occurs before a clicked eligible step is selected.
Linear-blocked clicks do not raise this event. Changing the collection or ActiveIndex in a handler cancels the pending automatic navigation. Clicking the selected step raises StepClick only.
Validating
EventHandler<StepCancelEventArgs> Occurs before navigation and allows the proposed move to be canceled.
This typed navigation event hides Control.Validating. It is independent of focus validation; access the inherited focus-validation event through a Control reference when needed. Both forward and backward navigation validate; ActiveIndex assignment does not.
Example:
stepper.Validating += (sender, e) =>
{
if (e.TargetIndex > e.Index && e.Step?.State == StepState.Error)
e.Cancel = true;
};
Implements
| Name | Description |
|---|---|
| IUserData | Provides access to the UserData and Tag properties associated to the component implementing this interface. |
| IBindableComponent | Bindable components implement this interface. |
| IDropTarget | Controls that support drag & drop operations implement this interface. |
| IWisejComponent | All wisej components implement this interface. |
| IWisejControl | All wisej controls derived from the Control class must implement this interface. |
| IWisejSerializable | Allows an object to serialize itself. |