Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reunion 0.5.5: Attribute metadata missing #767

Closed
dayman40 opened this issue Apr 27, 2021 · 1 comment
Closed

Reunion 0.5.5: Attribute metadata missing #767

dayman40 opened this issue Apr 27, 2021 · 1 comment

Comments

@dayman40
Copy link
Contributor

dayman40 commented Apr 27, 2021

Fixed in 0.5.6

In Reunion 0.5.0, the TemplatePart attribute was defined correctly, however there looks to be a regression in 0.5.5.

See the below code blocks showing how the TemplatePartAttribute is missing attribute metadata in Reunion 0.5.5 compared to Reunion 0.5.0.

Reunion 0.5.5:

namespace Microsoft.UI.Xaml
{
    // Summary:
    //     Represents an attribute that is applied to the class definition to identify the
    //     types of the named parts that are used for templating.

    [WindowsRuntimeType("Microsoft.UI")]  Notice all metadata data missing

    public sealed class TemplatePartAttribute : Attribute

    {
        public string Name;
        public Type Type;

        // Summary:
        //     Initializes a new instance of the TemplatePartAttribute class.
        public TemplatePartAttribute();
    }
}

Reunion 0.5.0:

namespace Microsoft.UI.Xaml
{
    // Summary:
    //     Represents an attribute that is applied to the class definition to identify the
    //     types of the named parts that are used for templating.

    [AllowMultiple]
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
    [ContractVersion(typeof(WinUIContract), 65536)]
    [WebHostHidden]
    [WindowsRuntimeType("Microsoft.UI")]

    public sealed class TemplatePartAttribute : Attribute
    {
        public string Name;
        public Type Type;

        // Summary:
        //     Initializes a new instance of the TemplatePartAttribute class.
        public TemplatePartAttribute();
    }
}

This code is failing to compile with error CS0579.

Severity Code Description Project File Line Suppression State
Error CS0579 Duplicate 'TemplatePart' attribute SpectrumComponents * 60 N/A

[TemplatePart(Name = PartDialogButton1, Type = typeof(SpectrumButton))]

[TemplatePart(Name = PartDialogButton2, Type = typeof(SpectrumButton))]

[TemplatePart(Name = PartDialogButton3, Type = typeof(SpectrumButton))]

[TemplatePart(Name = PartDialogTitle, Type = typeof(ContentControl))]

[TemplatePart(Name = PartDialogIcon, Type = typeof(BitmapIcon))]

[TemplatePart(Name = PartDialogContent, Type = typeof(ContentPresenter))]

[TemplatePart(Name = PartDialogButtonPanel, Type = typeof(Grid))]

public sealed partial class SpectrumDialog : ContentDialog {}
@ghost ghost added the needs-triage label Apr 27, 2021
@ghost ghost removed the needs-triage label Apr 27, 2021
@microsoft microsoft deleted a comment from riverar Apr 27, 2021
@dotMorten
Copy link
Contributor

dotMorten commented Apr 27, 2021

Did this only affect the TemplatePartAttribute class, or all attributes? Title seems to indicate them all, so it's not clear if the description is just an example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants