We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

WPF Wizard - event nadlers for navigation buttons

Hi,

how to capture events for navigation Buttons?

1. I want to avoid going to Next Page when some condition Fail.

2. I wanted to Open a New Window on Click of Finish Button

3. How to configure close and control the parent dialog's (modal Window) DialogResult property when the "Cancel" and "Finish" buttons are clicked

Thx

1 Reply

VM Venugopal M Syncfusion Team December 8, 2009 12:18 PM UTC

Hi Nan,

Thanks for your interest in Syncfusion products. Please find my response for your queries.

1. I want to avoid going to Next Page when some condition Fail.

You can use SelectedPageChanging event of WizardControl to cancel the next page selection based on some condition check.

For instance :



WizardPageSelectionChangeEventArgs has Cancel property to cancel the next page selection as follows.
private void wizardControl_SelectedPageChanging(object sender, WizardPageSelectionChangeEventArgs e)
{
if (Condition)
e.Cancel = true;
else
e.Cancel = false;
}

2. I wanted to Open a New Window on Click of Finish Button.

Register the Finish event of WizardControl and open your new window as mentioned below.

private void wizardControl_Finish(object sender, RoutedEventArgs e)
{
Window mywindow = new Window();
mywindow.Show();
}

3. How to configure close and control the parent dialog's (modal Window) DialogResult property when the "Cancel" and "Finish" buttons are clicked

As we did in your second query, you can use Cancel of Finish event which is available in WizardControl class to achieve this.

Note :

You can also make use of CancelButtonCancelsWindow and FinishButtonClosesWindow property to close the parent window automatically.

Please let me know if you have any questions.

Thanks,
Venugopal.

Loader.
Live Chat Icon For mobile
Up arrow icon