/// <summary> /// This is called when the wizard needs to cleanup things, it will call Terminate on every screen /// </summary> public virtual void Terminate() { _screenObservable?.Dispose(); Log.Verbose().WriteLine("Terminating wizard"); foreach (var wizardScreen in WizardScreens.OrderBy(x => x.Order)) { wizardScreen.Terminate(); } }
/// <summary>Called when activating.</summary> protected override void OnActivate() { // Order the items by ordering on Order Items.AddRange(WizardScreens.OrderBy(x => x.Order)); Initialize(); base.OnActivate(); }
/// <summary> /// This is called when the wizard needs to initialize stuff, it will call Initialize on every screen /// </summary> public virtual void Initialize() { Log.Verbose().WriteLine("Initializing wizard"); foreach (var wizardScreen in WizardScreens.OrderBy(x => x.Order)) { wizardScreen.ParentWizard = this; wizardScreen.Initialize(); } }
/// <summary> /// Called to check whether or not this instance can close. /// </summary> /// <param name="callback">The implementor calls this action with the result of the close check.</param> public override void CanClose(Action <bool> callback) { var result = true; foreach (var wizardScreen in WizardScreens.OrderBy(x => x.Order)) { wizardScreen.CanClose(canClose => result &= canClose); } callback(result); }