From d8f0c308a790f7090ebd33593479a1f8d3e40709 Mon Sep 17 00:00:00 2001 From: Samantha Houts Date: Fri, 1 Mar 2019 09:59:21 -0800 Subject: [PATCH] Reverts "[Xaml] require escaping curly braces (#4723)" and "[X] only require escaping if starts with '{' (#5169)" (#5424) * Revert "[X] only require escaping if starts with '{' (#5169)" This reverts commit cd73391c3a2d7ff60a95449cac255c1425e81a43. * Revert "[Xaml] require escaping curly braces (#4723)" This reverts commit 6753ace40e68f8aa6d45eefa90117f5650984c6f. * Make sure parsing doesn't fail when there *are* curly braces now --- .../EmptyViewTemplateGallery.xaml | 2 +- .../Issues/Gh2756.xaml | 10 --- .../Issues/Gh2756.xaml.cs | 34 ----------- .../Issues/Issue1438.xaml | 2 +- .../Issues/Issue1549.cs | 31 +++++++++- .../MarkupExpressionParserTests.cs | 22 +++---- Xamarin.Forms.Xaml/MarkupExpressionParser.cs | 14 +---- Xamarin.Forms.Xaml/MarkupExtensionParser.cs | 61 +++++++++---------- 8 files changed, 70 insertions(+), 106 deletions(-) delete mode 100644 Xamarin.Forms.Xaml.UnitTests/Issues/Gh2756.xaml delete mode 100644 Xamarin.Forms.Xaml.UnitTests/Issues/Gh2756.xaml.cs diff --git a/Xamarin.Forms.Controls/GalleryPages/CollectionViewGalleries/EmptyViewGalleries/EmptyViewTemplateGallery.xaml b/Xamarin.Forms.Controls/GalleryPages/CollectionViewGalleries/EmptyViewGalleries/EmptyViewTemplateGallery.xaml index b94c26882..da3560433 100644 --- a/Xamarin.Forms.Controls/GalleryPages/CollectionViewGalleries/EmptyViewGalleries/EmptyViewTemplateGallery.xaml +++ b/Xamarin.Forms.Controls/GalleryPages/CollectionViewGalleries/EmptyViewGalleries/EmptyViewTemplateGallery.xaml @@ -20,7 +20,7 @@ + Text="{Binding Filter, StringFormat='Your filter term of {0} did not match any records'}"> diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Gh2756.xaml b/Xamarin.Forms.Xaml.UnitTests/Issues/Gh2756.xaml deleted file mode 100644 index ada0d2ca5..000000000 --- a/Xamarin.Forms.Xaml.UnitTests/Issues/Gh2756.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Gh2756.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/Issues/Gh2756.xaml.cs deleted file mode 100644 index 52fbbd91e..000000000 --- a/Xamarin.Forms.Xaml.UnitTests/Issues/Gh2756.xaml.cs +++ /dev/null @@ -1,34 +0,0 @@ -using NUnit.Framework; - -using Xamarin.Forms.Core.UnitTests; - -using Xamarin.Forms; - -namespace Xamarin.Forms.Xaml.UnitTests -{ - [XamlCompilation(XamlCompilationOptions.Skip)] - public partial class Gh2756 : ContentPage - { - public Gh2756() => InitializeComponent(); - public Gh2756(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 UnescapedBraces([Values(false, true)]bool useCompiledXaml) - { - if (useCompiledXaml) - Assert.Throws(new XamlParseExceptionConstraint(8, 16), () => MockCompiler.Compile(typeof(Gh2756))); - else - Assert.Throws(new XamlParseExceptionConstraint(8, 16), () => new Gh2756(useCompiledXaml)); - } - } - } -} diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Issue1438.xaml b/Xamarin.Forms.Xaml.UnitTests/Issues/Issue1438.xaml index 442700fea..f31c52ab1 100644 --- a/Xamarin.Forms.Xaml.UnitTests/Issues/Issue1438.xaml +++ b/Xamarin.Forms.Xaml.UnitTests/Issues/Issue1438.xaml @@ -1,4 +1,4 @@ - + diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Issue1549.cs b/Xamarin.Forms.Xaml.UnitTests/Issues/Issue1549.cs index 8e59a3064..e73123c3b 100644 --- a/Xamarin.Forms.Xaml.UnitTests/Issues/Issue1549.cs +++ b/Xamarin.Forms.Xaml.UnitTests/Issues/Issue1549.cs @@ -82,7 +82,7 @@ xmlns=""http://xamarin.com/schemas/2014/forms"" - "; + + var layout = new ContentPage().LoadFromXaml(xaml); + layout.BindingContext = new { Value = "Foo", Severity = "Bar" }; + var label = layout.FindByName