This commit is contained in:
tyrrrz
2026-04-03 00:35:09 +03:00
parent 295f4cf9a2
commit 80e9ad75ba

View File

@@ -97,9 +97,10 @@ public class App : Application, IDisposable
{ {
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{ {
desktop.MainWindow = _services var viewManager = _services.GetRequiredService<ViewManager>();
.GetRequiredService<ViewManager>() var viewModelManager = _services.GetRequiredService<ViewModelManager>();
.TryBindWindow(_services.GetRequiredService<ViewModelManager>().GetMainViewModel());
desktop.MainWindow = viewManager.TryBindWindow(viewModelManager.GetMainViewModel());
// Although `App.Dispose()` is invoked from `Program.Main(...)`, on some platforms // Although `App.Dispose()` is invoked from `Program.Main(...)`, on some platforms
// it may be called too late in the shutdown lifecycle. Attach an exit // it may be called too late in the shutdown lifecycle. Attach an exit