diff options
Diffstat (limited to 'Xamarin.Forms.Core/Application.cs')
-rw-r--r-- | Xamarin.Forms.Core/Application.cs | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/Xamarin.Forms.Core/Application.cs b/Xamarin.Forms.Core/Application.cs index e089cf88..38333bf7 100644 --- a/Xamarin.Forms.Core/Application.cs +++ b/Xamarin.Forms.Core/Application.cs @@ -1,8 +1,9 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; - +using System.ComponentModel; using System.Threading.Tasks; +using Xamarin.Forms.Internals; using Xamarin.Forms.Platform; namespace Xamarin.Forms @@ -29,7 +30,7 @@ namespace Xamarin.Forms if (f) Loader.Load(); NavigationProxy = new NavigationImpl(this); - Current = this; + SetCurrentApplication(this); SystemResources = DependencyService.Get<ISystemResourcesProvider>().GetSystemResources(); SystemResources.ValuesChanged += OnParentResourcesChanged; @@ -48,10 +49,13 @@ namespace Xamarin.Forms } } + [EditorBrowsable(EditorBrowsableState.Never)] + public static void SetCurrentApplication(Application value) => Current = value; + public static Application Current { get { return s_current; } - internal set + set { if (s_current == value) return; @@ -109,9 +113,11 @@ namespace Xamarin.Forms get { return _logicalChildren ?? (_logicalChildren = new ReadOnlyCollection<Element>(InternalChildren)); } } - internal NavigationProxy NavigationProxy { get; } + [EditorBrowsable(EditorBrowsableState.Never)] + public NavigationProxy NavigationProxy { get; } - internal int PanGestureId { get; set; } + [EditorBrowsable(EditorBrowsableState.Never)] + public int PanGestureId { get; set; } internal IResourceDictionary SystemResources { get; } @@ -182,12 +188,14 @@ namespace Xamarin.Forms { } - internal static void ClearCurrent() + [EditorBrowsable(EditorBrowsableState.Never)] + public static void ClearCurrent() { s_current = null; } - internal static bool IsApplicationOrNull(Element element) + [EditorBrowsable(EditorBrowsableState.Never)] + public static bool IsApplicationOrNull(Element element) { return element == null || element is Application; } @@ -214,24 +222,28 @@ namespace Xamarin.Forms internal event EventHandler PopCanceled; - internal void SendOnAppLinkRequestReceived(Uri uri) + [EditorBrowsable(EditorBrowsableState.Never)] + public void SendOnAppLinkRequestReceived(Uri uri) { OnAppLinkRequestReceived(uri); } - internal void SendResume() + [EditorBrowsable(EditorBrowsableState.Never)] + public void SendResume() { s_current = this; OnResume(); } - internal Task SendSleepAsync() + [EditorBrowsable(EditorBrowsableState.Never)] + public Task SendSleepAsync() { OnSleep(); return SavePropertiesAsync(); } - internal void SendStart() + [EditorBrowsable(EditorBrowsableState.Never)] + public void SendStart() { OnStart(); } |