In my WPF application I use this code to open a new windows from a button:
private void LoginBtn_Click(object sender, RoutedEventArgs e)
{
LoginDialog dialog = new LoginDialog();
dialog.Show();
}
But when there is already a LoginDialog open and I click the LoginBtn again it open a new LoginDialog windows. How do I code it so it override the previous one that is open, if any.