summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core
diff options
context:
space:
mode:
authorE.Z. Hart <hartez@users.noreply.github.com>2017-01-12 11:50:37 (GMT)
committerRui Marinho <me@ruimarinho.net>2017-01-12 11:50:37 (GMT)
commit32df5c0ae5ad66e2ed25926d97b62c29f1b9e134 (patch)
treef4c0cd9dfc23726b63e15bbc255817e480ee18b1 /Xamarin.Forms.Core
parent1d58aaec70266cf8bbbd3f94d2dd55719263eccd (diff)
downloadxamarin-forms-32df5c0ae5ad66e2ed25926d97b62c29f1b9e134.zip
xamarin-forms-32df5c0ae5ad66e2ed25926d97b62c29f1b9e134.tar.gz
xamarin-forms-32df5c0ae5ad66e2ed25926d97b62c29f1b9e134.tar.bz2
Don't set up the properties task until it's requested (#671)
Diffstat (limited to 'Xamarin.Forms.Core')
-rw-r--r--Xamarin.Forms.Core/Application.cs13
1 files changed, 10 insertions, 3 deletions
diff --git a/Xamarin.Forms.Core/Application.cs b/Xamarin.Forms.Core/Application.cs
index ac9aa1b..e089cf8 100644
--- a/Xamarin.Forms.Core/Application.cs
+++ b/Xamarin.Forms.Core/Application.cs
@@ -10,7 +10,7 @@ namespace Xamarin.Forms
public class Application : Element, IResourcesProvider, IApplicationController, IElementConfiguration<Application>
{
static Application s_current;
- readonly Task<IDictionary<string, object>> _propertiesTask;
+ Task<IDictionary<string, object>> _propertiesTask;
readonly Lazy<PlatformConfigurationRegistry<Application>> _platformConfigurationRegistry;
IAppIndexingProvider _appIndexProvider;
@@ -30,7 +30,6 @@ namespace Xamarin.Forms
Loader.Load();
NavigationProxy = new NavigationImpl(this);
Current = this;
- _propertiesTask = GetPropertiesAsync();
SystemResources = DependencyService.Get<ISystemResourcesProvider>().GetSystemResources();
SystemResources.ValuesChanged += OnParentResourcesChanged;
@@ -94,7 +93,15 @@ namespace Xamarin.Forms
public IDictionary<string, object> Properties
{
- get { return _propertiesTask.Result; }
+ get
+ {
+ if (_propertiesTask == null)
+ {
+ _propertiesTask = GetPropertiesAsync();
+ }
+
+ return _propertiesTask.Result;
+ }
}
internal override ReadOnlyCollection<Element> LogicalChildrenInternal