WizardEventArgs.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #nullable disable
  2. namespace Terminal.Gui.Views;
  3. /// <summary><see cref="EventArgs"/> for <see cref="WizardStep"/> transition events.</summary>
  4. public class WizardButtonEventArgs : EventArgs
  5. {
  6. /// <summary>Initializes a new instance of <see cref="WizardButtonEventArgs"/></summary>
  7. public WizardButtonEventArgs () { Cancel = false; }
  8. /// <summary>Set to true to cancel the transition to the next step.</summary>
  9. public bool Cancel { get; set; }
  10. }
  11. /// <summary><see cref="EventArgs"/> for <see cref="WizardStep"/> events.</summary>
  12. public class StepChangeEventArgs : EventArgs
  13. {
  14. /// <summary>Initializes a new instance of <see cref="StepChangeEventArgs"/></summary>
  15. /// <param name="oldStep">The current <see cref="WizardStep"/>.</param>
  16. /// <param name="newStep">The new <see cref="WizardStep"/>.</param>
  17. public StepChangeEventArgs (WizardStep oldStep, WizardStep newStep)
  18. {
  19. OldStep = oldStep;
  20. NewStep = newStep;
  21. Cancel = false;
  22. }
  23. /// <summary>Event handlers can set to true before returning to cancel the step transition.</summary>
  24. public bool Cancel { get; set; }
  25. /// <summary>The <see cref="WizardStep"/> the <see cref="Wizard"/> is changing to or has changed to.</summary>
  26. public WizardStep NewStep { get; }
  27. /// <summary>The current (or previous) <see cref="WizardStep"/>.</summary>
  28. public WizardStep OldStep { get; }
  29. }