Posted 15 years ago
by Rod Kuhns

When user presses Finish Button, I have a task that takes some time to run. I would like to set the Finish Button to a disabled state once finish is pressed while the long task is performed to prevent user from pressing it several times, not knowing if thier first button press did anything. Using the following code the button does not change to a disabled state prior performing the task in wizard_Finish.
private void wizard_PreviewFinish(object sender, RoutedEventArgs e)
{
wizard.FinishButtonEnabled = false;
this.Cursor = Cursors.Wait;
wizard.InvalidateVisual(); //attempt at getting button to draw as disabled
}
private void wizard_Finish(object sender, RoutedEventArgs e)
{
//perform long running task...
NewProjectWizardViewModel.Instance.ProjectSaveRequested = true;
}
The wait cursor does get displayed. How do I get the Finish Button to display as non-Enabled while the wizard_Finish task runs?
Thank you for any suggestions!
Rod
ActiproSoftware.Wizard.Wpf30 Reference Properties:
Runtime Version: v2.0.50727
Version: 9.2.511.0
[Modified at 05/06/2010 09:47 AM]
[Modified at 05/06/2010 03:22 PM]
private void wizard_PreviewFinish(object sender, RoutedEventArgs e)
{
wizard.FinishButtonEnabled = false;
this.Cursor = Cursors.Wait;
wizard.InvalidateVisual(); //attempt at getting button to draw as disabled
}
private void wizard_Finish(object sender, RoutedEventArgs e)
{
//perform long running task...
NewProjectWizardViewModel.Instance.ProjectSaveRequested = true;
}
The wait cursor does get displayed. How do I get the Finish Button to display as non-Enabled while the wizard_Finish task runs?
Thank you for any suggestions!
Rod
ActiproSoftware.Wizard.Wpf30 Reference Properties:
Runtime Version: v2.0.50727
Version: 9.2.511.0
[Modified at 05/06/2010 09:47 AM]
[Modified at 05/06/2010 03:22 PM]