- fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/817710?src=WorkItemMention&src-action=artifact_link
- reverts #4582
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Xamarin.Forms.Xaml.UnitTests.DO817710">
+ <ContentPage.Resources />
+</ContentPage>
--- /dev/null
+using System;
+using NUnit.Framework;
+using Xamarin.Forms.Core.UnitTests;
+
+using Xamarin.Forms;
+
+namespace Xamarin.Forms.Xaml.UnitTests
+{
+ public partial class DO817710 : ContentPage
+ {
+ public DO817710() => InitializeComponent();
+ public DO817710(bool useCompiledXaml)
+ {
+ //this stub will be replaced at compile time
+ }
+
+ [TestFixture]
+ class Tests
+ {
+ [SetUp] public void Setup() => Device.PlatformServices = new MockPlatformServices();
+ [TearDown] public void TearDown() => Device.PlatformServices = null;
+
+ [Test]
+ public void EmptyResourcesElement([Values(false, true)]bool useCompiledXaml)
+ {
+ Assert.DoesNotThrow(() => new DO817710(useCompiledXaml: useCompiledXaml));
+ }
+ }
+ }
+}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<ContentPage
- xmlns="http://xamarin.com/schemas/2014/forms"
- xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
- x:Class="Xamarin.Forms.Xaml.UnitTests.Gh4553">
- <Grid IsVisible="{Binding}">
- <Grid.ColumnDefinitions/>
- </Grid>
-</ContentPage>
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using NUnit.Framework;
-using Xamarin.Forms;
-using Xamarin.Forms.Core.UnitTests;
-
-namespace Xamarin.Forms.Xaml.UnitTests
-{
- [XamlCompilation(XamlCompilationOptions.Skip)]
- public partial class Gh4553 : ContentPage
- {
- public Gh4553()
- {
- InitializeComponent();
- }
- public Gh4553(bool useCompiledXaml)
- {
- //this stub will be replaced at compile time
- }
-
- [TestFixture]
- class Tests
- {
- [SetUp] public void Setup() => Device.PlatformServices = new MockPlatformServices();
- [TearDown] public void TearDown() => Device.PlatformServices = null;
-
- [TestCase(true), TestCase(false)]
- public void ThrowMeaningfulError(bool useCompiledXaml)
- {
- if (useCompiledXaml)
- Assert.Throws<XamlParseException>(() => MockCompiler.Compile(typeof(Gh4553)));
- else
- Assert.Throws<XamlParseException>(() => new Gh4553(useCompiledXaml));
- }
- }
- }
-}
else //Attached BP
name = new XmlName(reader.NamespaceURI, reader.LocalName);
+ INode prop = null;
if (reader.IsEmptyElement)
- throw new XamlParseException($"Unexpected empty element '<{reader.Name}/>'", (IXmlLineInfo)reader);
- var prop = ReadNode(reader);
+ Debug.WriteLine($"Unexpected empty element '<{reader.Name} />'", (IXmlLineInfo)reader);
+ else
+ prop = ReadNode(reader);
if (prop != null)
node.Properties.Add(name, prop);
}
IList<XmlType> typeArguments = null;
if (attributes.Any(kvp => kvp.Key == XmlName.xTypeArguments))
- {
- typeArguments =
- ((ValueNode)attributes.First(kvp => kvp.Key == XmlName.xTypeArguments).Value).Value as IList<XmlType>;
- }
+ typeArguments = ((ValueNode)attributes.First(kvp => kvp.Key == XmlName.xTypeArguments).Value).Value as IList<XmlType>;
node = new ElementNode(new XmlType(elementNsUri, elementName, typeArguments), elementNsUri,
reader as IXmlNamespaceResolver, elementXmlInfo.LineNumber, elementXmlInfo.LinePosition);