Closed papillon2k2 closed 1 week ago
Hi , didn’t have time to work but I’ll answer tomorrow
On Sun, 6 Aug 2023 at 15:49 papillon2k2 @.***> wrote:
In one of the steps of the wizard I am doing a long process, and if the user tries to close app during the process, I want to show a confirm dialog box to ask for confirmation. How could this be done?
— Reply to this email directly, view it on GitHub https://github.com/michaelscodingspot/WPF_MVVMC/issues/17, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF5WVCIBLIZ3OO3KYAQEPB3XT6HGRANCNFSM6AAAAAA3F4VO2E . You are receiving this because you are subscribed to this thread.Message ID: @.***>
-- Best Regards, Michael Shpilt Software Developer | Ozcode | michaelscodingspot.com
I think you can do this without using Regions and Controllers with something like this:
So, in main window, something like this:
<Grid>
<mvvmc:Region ControllerID="MyWizard" />
<UserControl x:Name="MyDialogBox">
...
</UserControl/>
</Grid>
When the user is about to navigate:
void Window_Closing(object sender, CancelEventArgs e)
{
if (IsDuringLongOperation())
{
e.Cancel = true;
}
MyDialogBox.Visibility = Visibility.Visibile.
}
Or just use a MessageBox like in the example.
Just to reiterate, this problem is best not solved with MVVMC in my opinion.
thanks!
In one of the steps of the wizard I am doing a long process, and if the user tries to close app during the process, I want to show a confirm dialog box to ask for confirmation. How could this be done?