Forráskód Böngészése

搜索框隐藏时不再开启线程关闭窗口

liufei 3 éve
szülő
commit
125cc72499
1 módosított fájl, 13 hozzáadás és 8 törlés
  1. 13 8
      MainWindow.xaml.cs

+ 13 - 8
MainWindow.xaml.cs

@@ -363,16 +363,21 @@ namespace GeekDesk
 
         public static void HideApp()
         {
-            if (RunTimeStatus.SEARCH_BOX_SHOW) mainWindow.HidedSearchBox();
-            new Thread(() =>
+            if (RunTimeStatus.SEARCH_BOX_SHOW)
             {
-                Thread.Sleep(100);
-                App.Current.Dispatcher.BeginInvoke(new Action(() =>
+                mainWindow.HidedSearchBox();
+                new Thread(() =>
                 {
-                    FadeStoryBoard(0, (int)CommonEnum.WINDOW_ANIMATION_TIME, Visibility.Collapsed);
-                }));
-            }).Start();
-            
+                    Thread.Sleep(100);
+                    App.Current.Dispatcher.BeginInvoke(new Action(() =>
+                    {
+                        FadeStoryBoard(0, (int)CommonEnum.WINDOW_ANIMATION_TIME, Visibility.Collapsed);
+                    }));
+                }).Start();
+            } else
+            {
+                FadeStoryBoard(0, (int)CommonEnum.WINDOW_ANIMATION_TIME, Visibility.Collapsed);
+            }
         }
 
         /// <summary>