summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Xaml
diff options
context:
space:
mode:
authorStephane Delcroix <stephane@delcroix.org>2017-02-10 10:07:00 (GMT)
committerGitHub <noreply@github.com>2017-02-10 10:07:00 (GMT)
commit3241fae11d6804268d1f67545e9d9eeb42f371e7 (patch)
tree4ccac9461a19848099fb47beb8d43a65324fd635 /Xamarin.Forms.Xaml
parent39f6e6325f39ccaa46137135cb33ced1a384495d (diff)
downloadxamarin-forms-3241fae11d6804268d1f67545e9d9eeb42f371e7.zip
xamarin-forms-3241fae11d6804268d1f67545e9d9eeb42f371e7.tar.gz
xamarin-forms-3241fae11d6804268d1f67545e9d9eeb42f371e7.tar.bz2
Xaml empty service provider (#736)
* [Xaml] AcceptEmptyServiceProvider * [XamlC] AcceptEmptyServiceProvider * docs
Diffstat (limited to 'Xamarin.Forms.Xaml')
-rw-r--r--Xamarin.Forms.Xaml/ApplyPropertiesVisitor.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Xamarin.Forms.Xaml/ApplyPropertiesVisitor.cs b/Xamarin.Forms.Xaml/ApplyPropertiesVisitor.cs
index 833d5d9..5b8a840 100644
--- a/Xamarin.Forms.Xaml/ApplyPropertiesVisitor.cs
+++ b/Xamarin.Forms.Xaml/ApplyPropertiesVisitor.cs
@@ -91,12 +91,12 @@ namespace Xamarin.Forms.Xaml
var valueProvider = value as IValueProvider;
if (markupExtension != null) {
- var serviceProvider = new XamlServiceProvider(node, Context);
+ var serviceProvider = value.GetType().GetTypeInfo().GetCustomAttribute<AcceptEmptyServiceProviderAttribute>() == null ? new XamlServiceProvider(node, Context) : null;
value = markupExtension.ProvideValue(serviceProvider);
}
if (valueProvider != null) {
- var serviceProvider = new XamlServiceProvider(node, Context);
+ var serviceProvider = value.GetType().GetTypeInfo().GetCustomAttribute<AcceptEmptyServiceProviderAttribute>() == null ? new XamlServiceProvider(node, Context) : null;
value = valueProvider.ProvideValue(serviceProvider);
}