Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

New Post: Toolkit wizard prevent closing OnFinish

$
0
0
Hi..
i am using the wizard to get some input from the user.
Now, in the last page, i need some input from the user...
the input will not be check for correctness untill the user clicks on the Finish button.
<xctk:Wizard x:Name="wizard" FinishButtonClosesWindow="True" HelpButtonVisibility="Hidden" Finish="WizardOnFinish">
private void WizardOnFinish(object sender, RoutedEventArgs e)
        { 
              bool b = UserEnteredCorrectData();
              if(!b)
             {
                 // DONT CLOSE THE WIZARD WINDOW
             }         
}
The problem iam having is, wheter i use
        e.Handled = false;
or
        e.Handled = true;
the wizard is closing whenever the user click on the Finish button in the wizard.

My question is:
how can i prevent the window from closing as long as the input is wrong?
i dont want to set the CanFinish property to false, i want the user to click on the Finish button and then i want to evaluate the user`s input..
any ideas?

Thanks in advance

Viewing all articles
Browse latest Browse all 4964

Trending Articles