xamarin/Xamarin.Forms

Shouldn't be able to reference sub-namespaces with Xaml

Ouverte

#5 704 ouverte le 27 mars 2019

 (2 commentaires) (0 réaction) (1 personne assignée)C# (1 926 forks)batch import
a/Xaml </>e/3 :clock3:help wantedin-progressinactivet/bug :bug:up-for-grabs

Métriques du dépôt

Stars
 (5 644 étoiles)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

Description

(from @TimBarham): Consider an app that has an Buttons namespace, and a Buttons.Flat namespace. There's a RoundedFlatButton type in the Buttons.Flat namespace, but it is referenced in XAML as if it was in the Buttons namespace:

<ContentPage ... xmlns:buttons="clr-namespace:Buttons">
    ...
    <buttons:Flat.RoundedFlatButton Text="A Button" />
    ...
</ContentPage>

That element is referring to the RoundedFlatButton type in the Buttons.Flat namespace. But such a usage is not valid XAML. Forms seems to handle this fine, but it should be interpreted as a property element, not an object element (only property elements can contain a period). Our intellisense (and the XET XAML parser) reject this (the specific error is that there is no RoundedFlatButton attached property found on type Flat).

Steps to Reproduce

Expected Behavior

Actual Behavior

Basic Information

  • Version with issue:
  • Last known good version:
  • IDE:
  • Platform Target Frameworks:
    • iOS:
    • Android:
    • UWP:
  • Android Support Library Version:
  • Nuget Packages:
  • Affected Devices:

Screenshots

Reproduction Link

Guide contributeur