diff options
Diffstat (limited to 'Xamarin.Forms.Core/Application.cs')
-rw-r--r-- | Xamarin.Forms.Core/Application.cs | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/Xamarin.Forms.Core/Application.cs b/Xamarin.Forms.Core/Application.cs index 1dfe258b..230b744b 100644 --- a/Xamarin.Forms.Core/Application.cs +++ b/Xamarin.Forms.Core/Application.cs @@ -10,7 +10,8 @@ namespace Xamarin.Forms { static Application s_current; readonly Task<IDictionary<string, object>> _propertiesTask; - + + IAppIndexingProvider _appIndexProvider; bool _isSaving; ReadOnlyCollection<Element> _logicalChildren; @@ -33,6 +34,18 @@ namespace Xamarin.Forms SystemResources.ValuesChanged += OnParentResourcesChanged; } + public IAppLinks AppLinks + { + get + { + if (_appIndexProvider == null) + throw new ArgumentException("No IAppIndexingProvider was provided"); + if (_appIndexProvider.AppLinks == null) + throw new ArgumentException("No AppLinks implementation was found, if in Android make sure you installed the Xamarin.Forms.AppLinks"); + return _appIndexProvider.AppLinks; + } + } + public static Application Current { get { return s_current; } @@ -94,6 +107,11 @@ namespace Xamarin.Forms ObservableCollection<Element> InternalChildren { get; } = new ObservableCollection<Element>(); + void IApplicationController.SetAppIndexingProvider(IAppIndexingProvider provider) + { + _appIndexProvider = provider; + } + public ResourceDictionary Resources { get { return _resources; } @@ -128,6 +146,10 @@ namespace Xamarin.Forms await SetPropertiesAsync(); } + protected virtual void OnAppLinkRequestReceived(Uri uri) + { + } + protected override void OnParentSet() { throw new InvalidOperationException("Setting a Parent on Application is invalid."); @@ -177,6 +199,11 @@ namespace Xamarin.Forms internal event EventHandler PopCanceled; + internal void SendOnAppLinkRequestReceived(Uri uri) + { + OnAppLinkRequestReceived(uri); + } + internal void SendResume() { s_current = this; |