Browse Source

Don't close hello there window if it's closing

CPKreuz 4 năm trước cách đây
mục cha
commit
012043950c

+ 2 - 2
PixiEditor/Views/Dialogs/HelloTherePopup.xaml.cs

@@ -35,7 +35,7 @@ namespace PixiEditor.Views.Dialogs
 
         public RelayCommand OpenHyperlinkCommand { get => FileViewModel.Owner.MiscSubViewModel.OpenHyperlinkCommand; }
 
-        private bool isClosing;
+        public bool IsClosing { get; private set; }
 
         public HelloTherePopup(FileViewModel fileViewModel)
         {
@@ -49,7 +49,7 @@ namespace PixiEditor.Views.Dialogs
             RecentlyOpenedEmpty = RecentlyOpened.Count == 0;
             RecentlyOpened.CollectionChanged += RecentlyOpened_CollectionChanged;
 
-            Closing += (_, _) => { isClosing = true; };
+            Closing += (_, _) => { IsClosing = true; };
 
             InitializeComponent();
 

+ 1 - 1
PixiEditor/Views/MainWindow.xaml.cs

@@ -46,7 +46,7 @@ namespace PixiEditor
         [Conditional("RELEASE")]
         private static void CloseHelloThereIfRelease()
         {
-            Application.Current.Windows.OfType<HelloTherePopup>().ToList().ForEach(x => x.Close());
+            Application.Current.Windows.OfType<HelloTherePopup>().ToList().ForEach(x => { if (!x.IsClosing) x.Close(); });
         }
 
         private void CommandBinding_CanExecute(object sender, CanExecuteRoutedEventArgs e)