Finish wizard early

Wizard for WPF Forum

Posted 11 years ago by Matt Swanton
Avatar
Hi,

Inside the SelectedPageChanging event I'd like to finish the script early if a particular condition is met.

I'd like to finish, rather than cancel the wizard.

I've tried calling WizardCommands.Finish.CanExecute in each of the following ways, but none of them will execute;

?WizardCommands.Finish.CanExecute(null, null)
false
?WizardCommands.Finish.CanExecute(null, e.OldSelectedPage)
false
?WizardCommands.Finish.CanExecute(null, e.NewSelectedPage)
false

Any ideas?
Thanks
Matt

Comments (3)

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Matt,

Hmm... maybe try calling it on the wizard itself as a target, although I would think that calling it on a page like you did would work.

The only other idea I have is perhaps WPF is caching the result. You can probably clear that with a call to:
CommandManager.InvalidateRequerySuggested();


Actipro Software Support

Posted 11 years ago by Matt Swanton
Avatar
Hi,

I tried both of those suggestions to no avail.

I did get round it however by performing this action in the SelectedPageChanged event rather than SelectedPageChanging - I'm not sure if this is going to have any knock on problems - but at the moment it seems ok.

Thanks for your help
Matt
Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Ahh, yes in SelectedPageChanging you could probably do it but you would need to set e.Cancel = true. Otherwise right after the event it switches to the specified next page after you put it on the Finish page. Sorry I didn't think of that earlier.


Actipro Software Support

The latest build of this product (v2019.1 build 0681) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.