summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Xaml/CreateValuesVisitor.cs
diff options
context:
space:
mode:
authorStephane Delcroix <stephane@delcroix.org>2016-12-04 22:08:11 +0100
committerGitHub <noreply@github.com>2016-12-04 22:08:11 +0100
commit39f2deb5e04886374e720013782c751a4bb7675d (patch)
tree64f2df7230760c26533730e73821a6dc5c7607da /Xamarin.Forms.Xaml/CreateValuesVisitor.cs
parentfb76107f4f3294a9d32c6983bc742ce8dff60cd8 (diff)
downloadxamarin-forms-39f2deb5e04886374e720013782c751a4bb7675d.tar.gz
xamarin-forms-39f2deb5e04886374e720013782c751a4bb7675d.tar.bz2
xamarin-forms-39f2deb5e04886374e720013782c751a4bb7675d.zip
[Xaml] support arrays as x:Arguments (#545)
* [Xaml] port some FactoryMethod tests to XamlC * [Xaml] support array parameters in factory ctors * [XamlC] support arrays as x:Arguments * fix build
Diffstat (limited to 'Xamarin.Forms.Xaml/CreateValuesVisitor.cs')
-rw-r--r--Xamarin.Forms.Xaml/CreateValuesVisitor.cs9
1 files changed, 8 insertions, 1 deletions
diff --git a/Xamarin.Forms.Xaml/CreateValuesVisitor.cs b/Xamarin.Forms.Xaml/CreateValuesVisitor.cs
index c2331bf1..817b62c8 100644
--- a/Xamarin.Forms.Xaml/CreateValuesVisitor.cs
+++ b/Xamarin.Forms.Xaml/CreateValuesVisitor.cs
@@ -107,7 +107,7 @@ namespace Xamarin.Forms.Xaml
Values[node] = value;
var markup = value as IMarkupExtension;
- if (markup != null && (value is TypeExtension || value is StaticExtension))
+ if (markup != null && (value is TypeExtension || value is StaticExtension || value is ArrayExtension))
{
var serviceProvider = new XamlServiceProvider(node, Context);
@@ -119,9 +119,16 @@ namespace Xamarin.Forms.Xaml
value = markup.ProvideValue(serviceProvider);
+ INode xKey;
+ if (!node.Properties.TryGetValue(XmlName.xKey, out xKey))
+ xKey = null;
+
node.Properties.Clear();
node.CollectionItems.Clear();
+ if (xKey != null)
+ node.Properties.Add(XmlName.xKey, xKey);
+
Values[node] = value;
}