From 80e9ad75bad8fdbe7592a82395d40a2df5f0508b Mon Sep 17 00:00:00 2001 From: tyrrrz <1935960+Tyrrrz@users.noreply.github.com> Date: Fri, 3 Apr 2026 00:35:09 +0300 Subject: [PATCH] Clean up --- DiscordChatExporter.Gui/App.axaml.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/DiscordChatExporter.Gui/App.axaml.cs b/DiscordChatExporter.Gui/App.axaml.cs index b4f624d3..6dfdc584 100644 --- a/DiscordChatExporter.Gui/App.axaml.cs +++ b/DiscordChatExporter.Gui/App.axaml.cs @@ -97,9 +97,10 @@ public class App : Application, IDisposable { if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) { - desktop.MainWindow = _services - .GetRequiredService() - .TryBindWindow(_services.GetRequiredService().GetMainViewModel()); + var viewManager = _services.GetRequiredService(); + var viewModelManager = _services.GetRequiredService(); + + desktop.MainWindow = viewManager.TryBindWindow(viewModelManager.GetMainViewModel()); // Although `App.Dispose()` is invoked from `Program.Main(...)`, on some platforms // it may be called too late in the shutdown lifecycle. Attach an exit