diff --git a/Examples/FluentExample/FluentExample.csproj b/Examples/FluentExample/FluentExample.csproj index 2086af6ed..a95c7a025 100644 --- a/Examples/FluentExample/FluentExample.csproj +++ b/Examples/FluentExample/FluentExample.csproj @@ -4,6 +4,7 @@ net8.0 preview enable + $(DefineConstants);POST_4148 diff --git a/Terminal.Gui/Views/Wizard/Wizard.cs b/Terminal.Gui/Views/Wizard/Wizard.cs index 50b21c7ed..8e2b3d28f 100644 --- a/Terminal.Gui/Views/Wizard/Wizard.cs +++ b/Terminal.Gui/Views/Wizard/Wizard.cs @@ -7,9 +7,17 @@ namespace Terminal.Gui.Views; /// navigate forward and backward through the Wizard. /// /// -/// The Wizard can be displayed either as a modal (pop-up) (like ) or as -/// an embedded . By default, is true. In this case launch the -/// Wizard with Application.Run(wizard). See for more details. +/// +/// The Wizard can be displayed either as a modal (pop-up) (like ) or as +/// an embedded . By default, is true. In this case launch the +/// Wizard with Application.Run(wizard). See for more details. +/// +/// +/// Phase 2: Since inherits from , which implements +/// with int? result type, the wizard automatically provides result +/// tracking through . Use the property to check if the +/// wizard was completed or canceled. +/// /// /// /// @@ -100,6 +108,23 @@ public class Wizard : Dialog /// Use the event to be notified when the user attempts to go back. public Button BackButton { get; } + /// + /// Gets whether the wizard was completed (the Finish button was pressed and event fired). + /// + /// + /// + /// This is a convenience property that checks if indicates the wizard was + /// finished rather than canceled. Since inherits from which + /// implements with int? result type, the + /// property contains the button index. The Finish button is added as the last button. + /// + /// + /// Returns if is not and equals + /// the index of the Next/Finish button, otherwise (canceled or Back button pressed). + /// + /// + public bool WasFinished => Result is { } && _finishedPressed; + /// Gets or sets the currently active . public WizardStep? CurrentStep {