I'm trying to display a modal login dialog after the MainWindow has been shown. (Like in SSMS)
I know this is not the MVVM approach but I'm using MainWindow's Loaded event where I call following code:
private void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
{
ViewModel.ShowLoginDialog();
}
In the ViewModel I'm calling:
public void ShowLoginDialog()
{
var vm = new LoginControlViewModel();
var window = new LoginWindow(vm);
window.ShowDialog();
}
Well the login dialog is shown, but the MainWindow only get's shown if the Dialog has been closed.
How do I display the MainWindow and the LoginDialog at the same time?