summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Xaml
diff options
context:
space:
mode:
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 833d5d94..5b8a8403 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);
}