Skip to content

[Blazor] component inheritance, rendering logic in base component #21764

Closed
@JvanderStad

Description

@JvanderStad

Follow up issue for #21664

My original issue was resolved with the following comment.

You can use class file (.cs) to inherit from the abstract component class and that way you'll control exactly what you override.

However, I use Razor RenderFragments in the overriden class

eg.

public override void SetupColumns()
{
	this[nameof(OrganizationQueryModel.Id)].RazorTemplate = (OrganizationQueryModel context) =>
	@<div>
		<img class="img-thumbnail circle thumb96 d-inline-block m-0" src="@(LinkGenerator.GetPathByAction<OrganizationController>(x=>x.Picture(context.Id)))" />
	</div>;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-blazorIncludes: Blazor, Razor Components

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions