forked from dotnet/maui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 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
1 parent
2ef55f1
commit 6f7f7fc
Showing
3 changed files
with
38 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
|
||
} | ||
} |
This file was deleted.
Oops, something went wrong.