From 6dffb80609013cbe5a2a1f7085f3bae455806931 Mon Sep 17 00:00:00 2001 From: Deterous <138427222+Deterous@users.noreply.github.com> Date: Sat, 4 Nov 2023 04:23:11 +1300 Subject: [PATCH] Focus main window after child window closes (#596) --- MPF.UI.Core/Windows/MainWindow.xaml.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MPF.UI.Core/Windows/MainWindow.xaml.cs b/MPF.UI.Core/Windows/MainWindow.xaml.cs index 184060d9..6b78c745 100644 --- a/MPF.UI.Core/Windows/MainWindow.xaml.cs +++ b/MPF.UI.Core/Windows/MainWindow.xaml.cs @@ -227,6 +227,8 @@ namespace MPF.UI.Core.Windows ShowInTaskbar = true, WindowStartupLocation = WindowStartupLocation.CenterOwner, }; + + discInformationWindow.Closed += delegate { this.Activate(); }; bool? result = discInformationWindow.ShowDialog(); // Copy back the submission info changes, if necessary @@ -263,6 +265,7 @@ namespace MPF.UI.Core.Windows WindowStartupLocation = WindowStartupLocation.CenterOwner, }; + optionsWindow.Closed += delegate { this.Activate(); }; optionsWindow.Closed += OnOptionsUpdated; optionsWindow.Show(); }