Showing a hidden WPF window
foreach (Window window in App.Current.Windows)
{
if (!window.IsActive)
{
window.Show();
}
}
Works fine for me
Window2 window2 = new Window2();
this.Visibility = Visibility.Collapsed;
window2.ShowDialog();
this.Visibility = Visibility.Visible;
Do this instead:
this.Visibility = Visibility.Collapsed;
...
this.Visibility = Visibility.Visible;
Also, I saw your comment above that this doesn't work. However, I started a new WPF project, did this, built and ran it. It works.
Note that there are no errors.