Skip to content

Commit 7c662c4

Browse files
rookiejavamyroot
authored andcommitted
Support Min/Max Height/Width on IView and applying MauiApp/MauiAppBuilder pattern
- Support Min/Max Height/Width on IView (dotnet#2265) - Updating .NET MAUI to use MauiApp/MauiAppBuilder pattern and use MS.Extensions.DependencyInjection (dotnet#2137)
1 parent 7717240 commit 7c662c4

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/Core/src/Platform/Tizen/MauiApplication.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ protected MauiApplication()
2121

2222
protected override void OnPreCreate()
2323
{
24-
base.OnPreCreate();
24+
get
25+
{
26+
IWindow? window = null;
27+
_virtualWindow?.TryGetTarget(out window);
28+
return window;
29+
}
30+
}
2531

2632
Elementary.Initialize();
2733
Elementary.ThemeOverlay();
@@ -38,10 +44,11 @@ protected override void OnPreCreate()
3844

3945
Services = _applicationContext.Services;
4046

41-
if (Services == null)
42-
throw new InvalidOperationException($"The {nameof(IServiceProvider)} instance was not found.");
47+
var mauiApp = CreateMauiApp();
48+
49+
Services = mauiApp.Services;
4350

44-
Current.Services.InvokeLifecycleEvents<TizenLifecycle.OnPreCreate>(del => del(this));
51+
Current.Services?.InvokeLifecycleEvents<TizenLifecycle.OnPreCreate>(del => del(this));
4552
}
4653

4754
protected override void OnCreate()

0 commit comments

Comments
 (0)