summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Xaml
diff options
context:
space:
mode:
authorStephane Delcroix <stephane@delcroix.org>2016-08-15 22:06:11 +0200
committerJason Smith <jason.smith@xamarin.com>2016-08-15 13:06:11 -0700
commit775df09a3e45e90128f9047e8618461d4c4411a0 (patch)
tree3bfb63278a218c9d1f753f5fdafb7de659a048b5 /Xamarin.Forms.Xaml
parent0390ea034694d4ad548e9f46cf6f3fa3f291d041 (diff)
downloadxamarin-forms-775df09a3e45e90128f9047e8618461d4c4411a0.tar.gz
xamarin-forms-775df09a3e45e90128f9047e8618461d4c4411a0.tar.bz2
xamarin-forms-775df09a3e45e90128f9047e8618461d4c4411a0.zip
[Xaml] x:Static in x:Arguments (#288)
* [Xaml] Support x:Static as x:Arguments * [XamlC] allow x:Static in x:Arguments * fix typo, remove commented code
Diffstat (limited to 'Xamarin.Forms.Xaml')
-rw-r--r--Xamarin.Forms.Xaml/CreateValuesVisitor.cs6
-rw-r--r--Xamarin.Forms.Xaml/ExpandMarkupsVisitor.cs10
-rw-r--r--Xamarin.Forms.Xaml/XamlParser.cs3
3 files changed, 15 insertions, 4 deletions
diff --git a/Xamarin.Forms.Xaml/CreateValuesVisitor.cs b/Xamarin.Forms.Xaml/CreateValuesVisitor.cs
index e52ae594..014d82c2 100644
--- a/Xamarin.Forms.Xaml/CreateValuesVisitor.cs
+++ b/Xamarin.Forms.Xaml/CreateValuesVisitor.cs
@@ -124,8 +124,8 @@ namespace Xamarin.Forms.Xaml
Values[node] = value;
- var typeExtension = value as TypeExtension;
- if (typeExtension != null)
+ var markup = value as IMarkupExtension;
+ if (markup != null && (value is TypeExtension || value is StaticExtension))
{
var serviceProvider = new XamlServiceProvider(node, Context);
@@ -135,7 +135,7 @@ namespace Xamarin.Forms.Xaml
foreach (var cnode in node.CollectionItems)
cnode.Accept(visitor, node);
- value = typeExtension.ProvideValue(serviceProvider);
+ value = markup.ProvideValue(serviceProvider);
node.Properties.Clear();
node.CollectionItems.Clear();
diff --git a/Xamarin.Forms.Xaml/ExpandMarkupsVisitor.cs b/Xamarin.Forms.Xaml/ExpandMarkupsVisitor.cs
index 0d5e9ee6..36e8fc17 100644
--- a/Xamarin.Forms.Xaml/ExpandMarkupsVisitor.cs
+++ b/Xamarin.Forms.Xaml/ExpandMarkupsVisitor.cs
@@ -12,6 +12,14 @@ namespace Xamarin.Forms.Xaml
Context = context;
}
+ public static readonly IList<XmlName> Skips = new List<XmlName>
+ {
+ XmlName.xKey,
+ XmlName.xTypeArguments,
+ XmlName.xFactoryMethod,
+ XmlName.xName
+ };
+
Dictionary<INode, object> Values
{
get { return Context.Values; }
@@ -44,7 +52,7 @@ namespace Xamarin.Forms.Xaml
XmlName propertyName;
if (!ApplyPropertiesVisitor.TryGetPropertyName(markupnode, parentNode, out propertyName))
return;
- if (ApplyPropertiesVisitor.Skips.Contains(propertyName))
+ if (Skips.Contains(propertyName))
return;
if (parentElement.SkipProperties.Contains(propertyName))
return;
diff --git a/Xamarin.Forms.Xaml/XamlParser.cs b/Xamarin.Forms.Xaml/XamlParser.cs
index 730c1624..7dd79d77 100644
--- a/Xamarin.Forms.Xaml/XamlParser.cs
+++ b/Xamarin.Forms.Xaml/XamlParser.cs
@@ -223,6 +223,9 @@ namespace Xamarin.Forms.Xaml
case "x:FactoryMethod":
propertyName = XmlName.xFactoryMethod;
break;
+ case "x:Arguments":
+ propertyName = XmlName.xArguments;
+ break;
default:
Debug.WriteLine("Unhandled {0}", reader.Name);
continue;