UI - Fixed empty screen when opening from tray

UI - Fixed editor getting stuck when closed to tray
This commit is contained in:
Robert committed 2022-07-16 21:27:34 +02:00
1 parent 311bdee8da
commit e2f456866a
4 files changed
+12 -8

No files matched your search

+3 -5
View File
@@ -1,5 +1,4 @@
using System;
using System;
using System.Linq;
using System.Threading.Tasks;
using Artemis.Core;
@@ -92,12 +91,11 @@ namespace Artemis.UI.Screens.Root
set => RaiseAndSetIfChanged(ref _titleBarViewModel, value);
}
private void CurrentMainWindowOnClosed(object? sender, EventArgs e)
private void CurrentMainWindowOnClosing(object? sender, EventArgs e)
{
_lifeTime.MainWindow = null;
SidebarViewModel = null;
Router.NavigateAndReset.Execute(new EmptyViewModel(this, "blank")).Subscribe();
OnMainWindowClosed();
}
@@ -190,7 +188,7 @@ namespace Artemis.UI.Screens.Root
SidebarViewModel = _sidebarVmFactory.SidebarViewModel(this);
_lifeTime.MainWindow = new MainWindow {DataContext = this};
_lifeTime.MainWindow.Show();
_lifeTime.MainWindow.Closed += CurrentMainWindowOnClosed;
_lifeTime.MainWindow.Closing += CurrentMainWindowOnClosing;
}
_lifeTime.MainWindow.WindowState = WindowState.Normal;