diff options
-rw-r--r-- | Xamarin.Forms.Build.Tasks/CreateObjectVisitor.cs | 5 | ||||
-rw-r--r-- | Xamarin.Forms.Xaml.UnitTests/McIgnorable.xaml | 5 | ||||
-rw-r--r-- | Xamarin.Forms.Xaml/ApplyPropertiesVisitor.cs | 2 | ||||
-rw-r--r-- | Xamarin.Forms.Xaml/CreateValuesVisitor.cs | 5 |
4 files changed, 14 insertions, 3 deletions
diff --git a/Xamarin.Forms.Build.Tasks/CreateObjectVisitor.cs b/Xamarin.Forms.Build.Tasks/CreateObjectVisitor.cs index 0dabb5d9..5f9adafd 100644 --- a/Xamarin.Forms.Build.Tasks/CreateObjectVisitor.cs +++ b/Xamarin.Forms.Build.Tasks/CreateObjectVisitor.cs @@ -58,8 +58,11 @@ namespace Xamarin.Forms.Build.Tasks public void Visit(ElementNode node, INode parentNode) { - if (node.SkipPrefix((node.NamespaceResolver ?? parentNode.NamespaceResolver).LookupPrefix(node.NamespaceURI))) + if (node.SkipPrefix((node.NamespaceResolver ?? parentNode.NamespaceResolver).LookupPrefix(node.NamespaceURI))) { + node.Properties.Clear(); + node.CollectionItems.Clear(); return; + } var typeref = node.XmlType.GetTypeReference(Module, node); TypeDefinition typedef = typeref.Resolve(); diff --git a/Xamarin.Forms.Xaml.UnitTests/McIgnorable.xaml b/Xamarin.Forms.Xaml.UnitTests/McIgnorable.xaml index 7cbd4aa5..1a196d7c 100644 --- a/Xamarin.Forms.Xaml.UnitTests/McIgnorable.xaml +++ b/Xamarin.Forms.Xaml.UnitTests/McIgnorable.xaml @@ -10,4 +10,9 @@ <ContentPage.BindingContext> <d:FooBar /> </ContentPage.BindingContext> + <StackLayout x:Name="stack"> + <d:FakeControlWithContent> + <Button /> + </d:FakeControlWithContent> + </StackLayout> </ContentPage> diff --git a/Xamarin.Forms.Xaml/ApplyPropertiesVisitor.cs b/Xamarin.Forms.Xaml/ApplyPropertiesVisitor.cs index 6d8792c4..cdcbe00d 100644 --- a/Xamarin.Forms.Xaml/ApplyPropertiesVisitor.cs +++ b/Xamarin.Forms.Xaml/ApplyPropertiesVisitor.cs @@ -9,7 +9,7 @@ using Xamarin.Forms.Xaml.Internals; namespace Xamarin.Forms.Xaml { - internal class ApplyPropertiesVisitor : IXamlNodeVisitor + class ApplyPropertiesVisitor : IXamlNodeVisitor { public static readonly IList<XmlName> Skips = new List<XmlName> { diff --git a/Xamarin.Forms.Xaml/CreateValuesVisitor.cs b/Xamarin.Forms.Xaml/CreateValuesVisitor.cs index 612b32f1..e52ae594 100644 --- a/Xamarin.Forms.Xaml/CreateValuesVisitor.cs +++ b/Xamarin.Forms.Xaml/CreateValuesVisitor.cs @@ -62,8 +62,11 @@ namespace Xamarin.Forms.Xaml { object value = null; - if (node.SkipPrefix(node.NamespaceResolver.LookupPrefix(node.NamespaceURI))) + if (node.SkipPrefix(node.NamespaceResolver.LookupPrefix(node.NamespaceURI))) { + node.Properties.Clear(); + node.CollectionItems.Clear(); return; + } XamlParseException xpe; var type = XamlParser.GetElementType(node.XmlType, node, Context.RootElement?.GetType().GetTypeInfo().Assembly, |