Skip to content

Parameter attribute not recognized on inherited property #5653

Closed
dotnet/razor
#835
@stsrki

Description

@stsrki

I have a base class for my ModalContent component.

public abstract class BaseModalContent : BaseComponent
{
    [Parameter]
    protected virtual bool IsCentered
    {
        get => isCentered;
        set
        {
            isCentered = value;

            ClassMapper.Dirty();
        }
    }

    [Parameter]
    protected virtual ModalSize Size
    {
        get => modalSize;
        set
        {
            modalSize = value;

            ClassMapper.Dirty();
        }
    }
}

Then in my BaseBootstrapModalContent I have

public abstract class BaseBootstrapModalContent : Base.BaseModalContent
{
    protected override bool IsCentered
    {
        get => base.IsCentered;
        set
        {
            DialogClassMapper.Dirty();

            base.IsCentered = value;
        }
    }

    protected override ModalSize Size
    {
        get => base.Size;
        set
        {
            DialogClassMapper.Dirty();

            base.Size = value;
        }
    }
}

But when I try to use this fields they are not suggested or recognized by the Razor.
image

I must say that the code is working as expected, it's just that the intellisense is not working.

Metadata

Metadata

Assignees

Labels

DoneThis issue has been fixedarea-blazorIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions