protected virtual WizardNavigationButton CreateForwardButton(IWizard wizard) { var button = new WizardNavigationButton { Content = _languageService.GetString("Wizard_Next"), IsVisibleEvaluator = () => !wizard.IsLastPage(), StyleEvaluator = (x) => { var styleName = !wizard.IsLastPage() ? "WizardNavigationPrimaryButtonStyle" : "WizardNavigationButtonStyle"; var application = System.Windows.Application.Current; return(application?.TryFindResource(styleName) as Style); }, Command = new TaskCommand(async() => { await wizard.MoveForwardAsync(); }, () => { if (!wizard.HandleNavigationStates) { return(true); } return(wizard.CanMoveForward); }) }; return(button); }
protected virtual WizardNavigationButton CreateForwardButton(IWizard wizard) { var button = new WizardNavigationButton { Content = _languageService.GetString("Wizard_Next"), IsVisibleEvaluator = () => !wizard.IsLastPage(), Command = new TaskCommand(async() => { await wizard.MoveForwardAsync(); }, () => { if (!wizard.HandleNavigationStates) { return(true); } return(wizard.CanMoveForward); }) }; return(button); }
public static async Task MoveForwardOrResumeAsync(this IWizard wizard) { Argument.IsNotNull(() => wizard); if (wizard.CanMoveForward) { Log.Debug("Moving forward from MoveNextOrResumeAsync()"); await wizard.MoveForwardAsync(); return; } if (wizard.CanResume) { Log.Debug("Resuming from MoveNextOrResumeAsync()"); await wizard.ResumeAsync(); return; } Log.Debug("Could not move forward or resume from MoveNextOrResumeAsync()"); }