Skip to content

Support enumarable of RenderFragment and RenderFragment<T> in components #29495

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

Closed
montyclt opened this issue Jan 21, 2021 · 2 comments
Closed
Labels
area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one
Milestone

Comments

@montyclt
Copy link

Is your feature request related to a problem? Please describe.

Support enumarable of RenderFragment and RenderFragment<T> in components.

Describe the solution you'd like

List.razor:

<ul>
    @foreach (var item in Items)
    {
        <li>@item</li>
    }
</ul>

@code {
    [Parameter(Tag = "Item")]
    public IEnumerable<RenderFragment> Items { get; set; }
}

Page.razor:

<List>
    <Item>Item 1</Item>
    <Item>Item 2</Item>
    <Item>Item 3</Item>
</List>

Additional context

Enumerables members usually are written in plural form, but in the usage, the singular form is more accurate. I propose add a parameter in [Parameter] attribute to specify the tag. This proposal should be available to any parameter like this:

Person.razor

[Parameter(Tag = "Name")]
public string FullName { get; set; }

Page.razor

<Person Name="Ivan" />
@javiercn javiercn added the area-blazor Includes: Blazor, Razor Components label Jan 21, 2021
@captainsafia captainsafia added the enhancement This issue represents an ask for new feature or an enhancement to an existing one label Jan 21, 2021
@captainsafia captainsafia added this to the Backlog milestone Jan 21, 2021
@ghost
Copy link

ghost commented Jan 21, 2021

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@SteveSandersonMS
Copy link
Member

I think this is a subset of the request in #29379 where we've done more design and analysis, so I'll close as a duplicate of that.

@ghost ghost locked as resolved and limited conversation to collaborators Feb 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one
Projects
None yet
Development

No branches or pull requests

4 participants