Skip to content

Commit 63449ff

Browse files
rookiejavamyroot
authored andcommitted
Bump to latest
- Apply to start adding in APIs for adding legacy renderers via assembly scanning (dotnet#1333) - Update to IMauiContext (dotnet#1357) - and so on
1 parent 64907fc commit 63449ff

File tree

4 files changed

+39
-33
lines changed

4 files changed

+39
-33
lines changed

src/Compatibility/Core/src/AppHostBuilderExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
using DefaultRenderer = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.DefaultRenderer;
4343
using StreamImagesourceHandler = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.StreamImageSourceHandler;
4444
using ImageLoaderSourceHandler = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.UriImageSourceHandler;
45+
using DefaultRenderer = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.DefaultRenderer;
4546
#endif
4647

4748
namespace Microsoft.Maui.Controls.Compatibility.Hosting

src/Core/src/IMauiContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public interface IMauiContext
1111
#if __ANDROID__
1212
Android.Content.Context? Context { get; }
1313
#elif TIZEN
14-
CoreUIAppContext Context { get; }
14+
CoreUIAppContext? Context { get; }
1515
#endif
1616
}
1717
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using System;
2+
3+
namespace Microsoft.Maui
4+
{
5+
public partial class MauiContext
6+
{
7+
readonly WeakReference<CoreUIAppContext>? _context;
8+
9+
public MauiContext(CoreUIAppContext context) : this()
10+
{
11+
_context = new WeakReference<CoreUIAppContext>(context ?? throw new ArgumentNullException(nameof(context)));
12+
}
13+
14+
public MauiContext(IServiceProvider services, CoreUIAppContext context) : this(services)
15+
{
16+
_context = new WeakReference<CoreUIAppContext>(context ?? throw new ArgumentNullException(nameof(context)));
17+
}
18+
19+
public CoreUIAppContext? Context
20+
{
21+
get
22+
{
23+
if (_context == null)
24+
return null;
25+
26+
CoreUIAppContext? context;
27+
if (_context.TryGetTarget(out context))
28+
{
29+
return context;
30+
}
31+
32+
return null;
33+
}
34+
}
35+
36+
}
37+
}

src/Core/src/Platform/Tizen/MauiContext.cs

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)