Skip to content

Commit

Permalink
Bump to latest
Browse files Browse the repository at this point in the history
- Apply to start adding in APIs for adding legacy renderers via assembly scanning (dotnet#1333)
- Update to IMauiContext (dotnet#1357)
- and so on
  • Loading branch information
rookiejava authored and myroot committed Aug 25, 2022
1 parent 67ee593 commit 26b3885
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 33 deletions.
1 change: 1 addition & 0 deletions src/Compatibility/Core/src/AppHostBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
using DefaultRenderer = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.DefaultRenderer;
using StreamImagesourceHandler = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.StreamImageSourceHandler;
using ImageLoaderSourceHandler = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.UriImageSourceHandler;
using DefaultRenderer = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.DefaultRenderer;
#endif

namespace Microsoft.Maui.Controls.Compatibility.Hosting
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/IMauiContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public interface IMauiContext
#if __ANDROID__
Android.Content.Context? Context { get; }
#elif TIZEN
CoreUIAppContext Context { get; }
CoreUIAppContext? Context { get; }
#endif
}
}
37 changes: 37 additions & 0 deletions src/Core/src/Platform/MauiContext.Tizen.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System;

namespace Microsoft.Maui
{
public partial class MauiContext
{
readonly WeakReference<CoreUIAppContext>? _context;

public MauiContext(CoreUIAppContext context) : this()
{
_context = new WeakReference<CoreUIAppContext>(context ?? throw new ArgumentNullException(nameof(context)));
}

public MauiContext(IServiceProvider services, CoreUIAppContext context) : this(services)
{
_context = new WeakReference<CoreUIAppContext>(context ?? throw new ArgumentNullException(nameof(context)));
}

public CoreUIAppContext? Context
{
get
{
if (_context == null)
return null;

CoreUIAppContext? context;
if (_context.TryGetTarget(out context))
{
return context;
}

return null;
}
}

}
}
32 changes: 0 additions & 32 deletions src/Core/src/Platform/Tizen/MauiContext.cs

This file was deleted.

0 comments on commit 26b3885

Please sign in to comment.