From fd158a59182ff26516cb1bc9cca8d0f9a8001869 Mon Sep 17 00:00:00 2001 From: Joseph Finney Date: Sun, 3 Mar 2024 21:28:11 -0600 Subject: [PATCH] catch Okay window count from FirstRun --- Text-Grab/Views/FirstRunWindow.xaml.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Text-Grab/Views/FirstRunWindow.xaml.cs b/Text-Grab/Views/FirstRunWindow.xaml.cs index cfc4bc43..4fa673f3 100644 --- a/Text-Grab/Views/FirstRunWindow.xaml.cs +++ b/Text-Grab/Views/FirstRunWindow.xaml.cs @@ -1,7 +1,6 @@ using System; using System.Diagnostics; using System.Windows; -using System.Windows.Controls; using System.Windows.Media; using Text_Grab.Properties; using Text_Grab.Utilities; @@ -110,7 +109,9 @@ private void NotificationsCheckBox_Checked(object sender, RoutedEventArgs e) private void OkayButton_Click(object sender, RoutedEventArgs e) { - if (System.Windows.Application.Current.Windows.Count == 1) + int windowsCount = Application.Current.Windows.Count; + + if (windowsCount == 2 || windowsCount == 1) { TextGrabMode defaultLaunchSetting = Enum.Parse(Settings.Default.DefaultLaunch, true); switch (defaultLaunchSetting) @@ -132,7 +133,7 @@ private void OkayButton_Click(object sender, RoutedEventArgs e) } } - this.Close(); + Close(); } private void RadioButton_Checked(object sender, RoutedEventArgs e) {