File tree Expand file tree Collapse file tree 4 files changed +39
-33
lines changed Expand file tree Collapse file tree 4 files changed +39
-33
lines changed Original file line number Diff line number Diff line change 42
42
using DefaultRenderer = Microsoft . Maui . Controls . Compatibility . Platform . Tizen . DefaultRenderer ;
43
43
using StreamImagesourceHandler = Microsoft . Maui . Controls . Compatibility . Platform . Tizen . StreamImageSourceHandler ;
44
44
using ImageLoaderSourceHandler = Microsoft . Maui . Controls . Compatibility . Platform . Tizen . UriImageSourceHandler ;
45
+ using DefaultRenderer = Microsoft . Maui . Controls . Compatibility . Platform . Tizen . DefaultRenderer ;
45
46
#endif
46
47
47
48
namespace Microsoft . Maui . Controls . Compatibility . Hosting
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ public interface IMauiContext
11
11
#if __ANDROID__
12
12
Android . Content . Context ? Context { get ; }
13
13
#elif TIZEN
14
- CoreUIAppContext Context { get ; }
14
+ CoreUIAppContext ? Context { get ; }
15
15
#endif
16
16
}
17
17
}
Original file line number Diff line number Diff line change
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
+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments