summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Build.Tasks
diff options
context:
space:
mode:
authorStephane Delcroix <stephane@delcroix.org>2016-12-23 08:50:19 +0100
committerGitHub <noreply@github.com>2016-12-23 08:50:19 +0100
commitb96df000db76ba3490589c37e93224271249bc88 (patch)
tree6389cd652ebe395b51829ee2ec1d41d285ed2fab /Xamarin.Forms.Build.Tasks
parent2c91b0facd2a25d0de9a283b44cf818329d4c06f (diff)
downloadxamarin-forms-b96df000db76ba3490589c37e93224271249bc88.tar.gz
xamarin-forms-b96df000db76ba3490589c37e93224271249bc88.tar.bz2
xamarin-forms-b96df000db76ba3490589c37e93224271249bc88.zip
[Xaml] support short Properties for PropertyCondition (#645)
Diffstat (limited to 'Xamarin.Forms.Build.Tasks')
-rw-r--r--Xamarin.Forms.Build.Tasks/CompiledConverters/BindablePropertyConverter.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/Xamarin.Forms.Build.Tasks/CompiledConverters/BindablePropertyConverter.cs b/Xamarin.Forms.Build.Tasks/CompiledConverters/BindablePropertyConverter.cs
index c1d11487..c78e5184 100644
--- a/Xamarin.Forms.Build.Tasks/CompiledConverters/BindablePropertyConverter.cs
+++ b/Xamarin.Forms.Build.Tasks/CompiledConverters/BindablePropertyConverter.cs
@@ -30,7 +30,8 @@ namespace Xamarin.Forms.Core.XamlC
var parts = value.Split('.');
if (parts.Length == 1) {
var parent = node.Parent?.Parent as IElementNode;
- if ((node.Parent as ElementNode)?.XmlType.NamespaceUri == "http://xamarin.com/schemas/2014/forms" && (node.Parent as ElementNode)?.XmlType.Name == "Setter") {
+ if ((node.Parent as ElementNode)?.XmlType.NamespaceUri == "http://xamarin.com/schemas/2014/forms" &&
+ ((node.Parent as ElementNode)?.XmlType.Name == "Setter" || (node.Parent as ElementNode)?.XmlType.Name == "PropertyCondition")) {
if (parent.XmlType.NamespaceUri == "http://xamarin.com/schemas/2014/forms" &&
(parent.XmlType.Name == "Trigger" || parent.XmlType.Name == "DataTrigger" || parent.XmlType.Name == "MultiTrigger" || parent.XmlType.Name == "Style")) {
var ttnode = (parent as ElementNode).Properties [new XmlName("", "TargetType")];
@@ -48,6 +49,9 @@ namespace Xamarin.Forms.Core.XamlC
} else
throw new XamlParseException($"Cannot convert \"{value}\" into {typeof(BindableProperty)}", node);
+ if (typeName == null || propertyName == null)
+ throw new XamlParseException($"Cannot convert \"{value}\" into {typeof(BindableProperty)}", node);
+
var typeRef = GetTypeReference(typeName, module, node);
if (typeRef == null)
throw new XamlParseException($"Can't resolve {typeName}", node);