diff --git a/src/Core/src/Platform/Tizen/MauiApplication.cs b/src/Core/src/Platform/Tizen/MauiApplication.cs index f5b52c59508e..cc75ecd8e481 100644 --- a/src/Core/src/Platform/Tizen/MauiApplication.cs +++ b/src/Core/src/Platform/Tizen/MauiApplication.cs @@ -21,7 +21,13 @@ protected MauiApplication() protected override void OnPreCreate() { - base.OnPreCreate(); + get + { + IWindow? window = null; + _virtualWindow?.TryGetTarget(out window); + return window; + } + } Elementary.Initialize(); Elementary.ThemeOverlay(); @@ -38,10 +44,11 @@ protected override void OnPreCreate() Services = _applicationContext.Services; - if (Services == null) - throw new InvalidOperationException($"The {nameof(IServiceProvider)} instance was not found."); + var mauiApp = CreateMauiApp(); + + Services = mauiApp.Services; - Current.Services.InvokeLifecycleEvents(del => del(this)); + Current.Services?.InvokeLifecycleEvents(del => del(this)); } protected override void OnCreate()