1
Vote

PRISM 5 : IConfirmNavigationRequest methods called more than once

description

I'm using PRISM and Unity extensions.

A WPF button command invokes the following code and displays dialog :

private void LaunchDialog()
{
        Bootstrapper bootstrapper = new  Bootstrapper();
        bootstrapper.Run();
        bootstrapper.MyShell.Owner = Application.Current.MainWindow;
        bootstrapper.MyShell.ShowDialog();
}

When I click LaunchDialog for the first time, the PRISM navigation methods OnNavigatedFrom and OnNavigatedTo calls once. I close the dialog,

When I click LaunchDialog for the next time, the PRISM navigation methods OnNavigatedFrom and OnNavigatedTo gets called twice. I close the dialog,

If I click LaunchDialog for third time, the PRISM navigation methods OnNavigatedFrom and OnNavigatedTo gets called thrice.I close the dialog,


How do I get rid of this behavior? So that Navigation methods are called only once as launched for the first time even if the user clicks LaunchDialog multiple times.

comments