Quellcode durchsuchen

Close startup window when example gets opened

CPKreuz vor 1 Jahr
Ursprung
Commit
80cf5c3a21
1 geänderte Dateien mit 13 neuen und 10 gelöschten Zeilen
  1. 13 10
      src/PixiEditor.AvaloniaUI/Views/Windows/HelloTherePopup.axaml.cs

+ 13 - 10
src/PixiEditor.AvaloniaUI/Views/Windows/HelloTherePopup.axaml.cs

@@ -155,16 +155,6 @@ internal partial class HelloTherePopup : PixiEditorPopup
         }
     }
 
-    private async Task OpenBetaExample(BetaExampleFile? arg)
-    {
-        await using var stream = arg.GetStream();
-        
-        var bytes = new byte[stream.Length];
-        await stream.ReadExactlyAsync(bytes);
-
-        FileViewModel.OpenRecoveredDotPixi(null, bytes);
-    }
-
     private static void NewsPanelCollapsedChangedCallback(AvaloniaPropertyChangedEventArgs<bool> e)
     {
         HelloTherePopup helloTherePopup = (HelloTherePopup)e.Sender;
@@ -205,6 +195,19 @@ internal partial class HelloTherePopup : PixiEditorPopup
         await FileViewModel.CreateFromNewFileDialog();
     }
 
+    private async Task OpenBetaExample(BetaExampleFile? arg)
+    {
+        await using var stream = arg.GetStream();
+        
+        var bytes = new byte[stream.Length];
+        await stream.ReadExactlyAsync(bytes);
+
+        Application.Current.ForDesktopMainWindow(mainWindow => mainWindow.Activate());
+        Close();
+        
+        FileViewModel.OpenRecoveredDotPixi(null, bytes);
+    }
+
     private void OpenRecent(string parameter)
     {
         Application.Current.ForDesktopMainWindow(mainWindow => mainWindow.Activate());