diff options
author | Stephane Delcroix <stephane@delcroix.org> | 2016-12-04 22:08:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-04 22:08:11 +0100 |
commit | 39f2deb5e04886374e720013782c751a4bb7675d (patch) | |
tree | 64f2df7230760c26533730e73821a6dc5c7607da /Xamarin.Forms.Xaml/CreateValuesVisitor.cs | |
parent | fb76107f4f3294a9d32c6983bc742ce8dff60cd8 (diff) | |
download | xamarin-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.cs | 9 |
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; } |