diff --git a/DesktopClock/App.xaml.cs b/DesktopClock/App.xaml.cs index 6e36f12..5f6a705 100644 --- a/DesktopClock/App.xaml.cs +++ b/DesktopClock/App.xaml.cs @@ -49,14 +49,17 @@ static string GetSha256Hash(string text) public static void ShowSingletonWindow(Window owner) where T : Window, new() { var window = Current.Windows.OfType().FirstOrDefault() ?? new T(); + window.Owner = owner; + // Restore an existing window. if (window.IsVisible) { + SystemCommands.RestoreWindow(window); window.Activate(); return; } - window.Owner = owner; + // Show the new window. window.Show(); } }