From becc6e0715f6da061964ca4962505bc2f632bf7f Mon Sep 17 00:00:00 2001 From: Diogo Trindade Date: Sat, 6 May 2023 15:39:47 +0100 Subject: [PATCH] Linux - cleanup initialization --- src/Artemis.UI.Linux/App.axaml.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Artemis.UI.Linux/App.axaml.cs b/src/Artemis.UI.Linux/App.axaml.cs index 1a6cd64a5..52f729727 100644 --- a/src/Artemis.UI.Linux/App.axaml.cs +++ b/src/Artemis.UI.Linux/App.axaml.cs @@ -22,18 +22,20 @@ public class App : Application Program.CreateLogger(_container); RxApp.MainThreadScheduler = AvaloniaScheduler.Instance; AvaloniaXamlLoader.Load(this); - - RegisterProviders(); } public override void OnFrameworkInitializationCompleted() { if (Design.IsDesignMode) return; - + + if (ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop) + return; + ArtemisBootstrapper.Initialize(); - if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) - _applicationStateManager = new ApplicationStateManager(_container!, desktop.Args); + + _applicationStateManager = new ApplicationStateManager(_container!, desktop.Args); + RegisterProviders(); } private void RegisterProviders()