WildGums/Orc.Wizard

wizard with model don`t work

Closed this issue · 8 comments

in MyExampleWizard i add new constructor
public MyExampleWizard(ITypeFactory typeFactory, MyModel model)
: base(typeFactory)

I try create wizard with model, but i can`t.
_wizardService.ShowWizardAsync(model);

"Argument 'wizard' cannot be null"

just try to change the order of the arguments in your constructor

ok. thats work. thanks.
but how i can get the result?
ShowWizardAsync from IWizardServiceExtensions rerurn Task, not Task<bool?>

The wizard model you injected should have all info?

i mean:
MyModel model = new MyModel();
IWizardService _wizardService = dependencyResolver.Resolve<IWizardService>();
if (_wizardService.ShowWizardAsync<MyExampleWizard>(model) ?? false)
//do work with model
thats not work, becourse ShowWizardAsync return only Task

use 'await':

if (await _wizardService.ShowWizardAsync<MyExampleWizard>(model) ?? false)
{

}

are you using Catel for dependency resolving?

i always try it.
yes, i using Catel.
now i work through IUIVisualizerService:
if (await _uiVisualizerService.ShowDialogAsync(wizard) ?? false)
it work.
But through IWizardService dont.

looks like a bug? good catch, thanks.
it should work without model injection.

feel free to make a PR for making it work with model as well

lock commented

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.