Skip to content

Commit

Permalink
Restore minimzed settings window
Browse files Browse the repository at this point in the history
  • Loading branch information
danielchalmers committed Jul 16, 2024
1 parent 533e09f commit 4b9f9a8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion DesktopClock/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,17 @@ static string GetSha256Hash(string text)
public static void ShowSingletonWindow<T>(Window owner) where T : Window, new()
{
var window = Current.Windows.OfType<T>().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();
}
}

0 comments on commit 4b9f9a8

Please sign in to comment.