Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Breaking Xaml changes on XF 3.1 #3136

Closed
EmilAlipiev opened this issue Jun 24, 2018 · 3 comments
Closed

Breaking Xaml changes on XF 3.1 #3136

EmilAlipiev opened this issue Jun 24, 2018 · 3 comments

Comments

@EmilAlipiev
Copy link
Contributor

I just wanted to inform you that if you upgrade on XF 3.1 version, you may get xaml errors telling that "member names cannot be the same as their enclosing type". this is a well known C# error if parent and child types have same name

reason for that is code below works in versions before XF 3.1 but returns error on XF 3.1 ... I am not sure if that is supposed to be a bug or a fix of a bug all the time?


<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"

             x:Class="myApp.TestPage"  x:Name="TestPage" > 

  <ContentPage.Content>

            <c:cwTest x:Name="cwTest"  VerticalOptions="FillAndExpand"  HorizontalOptions="FillAndExpand"/>

  </ContentPage.Content>
</ContentPage>
@pauldipietro pauldipietro added this to New in Triage Jun 24, 2018
@StephaneDelcroix StephaneDelcroix self-assigned this Jun 25, 2018
@StephaneDelcroix StephaneDelcroix added this to the 3.1.0 milestone Jun 25, 2018
@StephaneDelcroix StephaneDelcroix added this to Ready in v3.1.0 via automation Jun 25, 2018
@StephaneDelcroix StephaneDelcroix moved this from New to Ready For Work in Triage Jun 25, 2018
@StephaneDelcroix
Copy link
Member

The only thing that changed is that we now creates a field for x:Name defined at the top-level XAML element, so it can be accessed from code-behind eventually, and we weren't before.

You could reproduce that behavior with any previous version of XF by having a Label or any element in your xaml with a `x:Name="TestPage"' attribute.

We're sorry if it breaks some of your code. After careful consideration, this is not considered a bug or a regression. Your code used to rely on a missing validation, but you can't exploit this failure anymore.

The workaround for this is trivial, straightforward, and very simple to put in place.

v3.1.0 automation moved this from Ready to Done Jun 25, 2018
Triage automation moved this from Ready For Work to Closed Jun 25, 2018
@EmilAlipiev
Copy link
Contributor Author

@StephaneDelcroix I agree with that. I only brought to your attention because you should have highlighted it. VS2017 doesnt give me enough information, rather it throws 100s of errors for a single file. once i restore back to 3.0, all works fine. just for anybody else having this error to reference this issue.

@daveclarke
Copy link

@EmilAlipiev @StephaneDelcroix yes, would have been helpful to be forewarned. This is a breaking change and your sort of apology/excuse is unhelpful.

@samhouts samhouts removed this from Closed in Triage Jul 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
v3.1.0
  
Done
Development

No branches or pull requests

3 participants