Identifying which button is clicked(Back or Next)?

Wizard for WPF Forum

Posted 9 years ago by Doraiswamy
Avatar
I am trying to do validation and i tried as the code given in the Actipro document

private void wizard_SelectedPageChanging(object sender, WizardSelectedPageChangeEventArgs e) {
if (e.OldSelectedPage == dataEntryPage) {
// some length validation

}

This is working fine if i click "Next" button but this validation occurs even while i use "Back" button.

Is there any way to restrict this?. I am trying to use WizardPageSelectionFlags to know whether back or forward page is requested but in vain?. Any suggestion please.

Comments (2)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
You can use code like this to know if you are moving backwards and then filter out your code based on that:
bool isBackwardProgress = ((e.SelectionFlags & WizardPageSelectionFlags.BackwardProgress) == WizardPageSelectionFlags.BackwardProgress);


Actipro Software Support

Posted 9 years ago by Doraiswamy
Avatar
much thanks. I really missed and overlooked.
The latest build of this product (v2019.1 build 0683) was released 19 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.