Microsoft.AspNetCore.Components by Microsoft

<PackageReference Include="Microsoft.AspNetCore.Components" Version="5.0.3" />

 ComponentBase

Optional base class for components. Alternatively, components may implement IComponent directly.
public ComponentBase()

Constructs an instance of ComponentBase.

protected virtual void BuildRenderTree(RenderTreeBuilder builder)

Renders the component to the supplied RenderTreeBuilder.

protected Task InvokeAsync(Action workItem)

Executes the supplied work item on the associated renderer's synchronization context.

protected Task InvokeAsync(Func<Task> workItem)

Executes the supplied work item on the associated renderer's synchronization context.

protected virtual void OnAfterRender(bool firstRender)

Method invoked after each time the component has been rendered.

protected virtual Task OnAfterRenderAsync(bool firstRender)

Method invoked after each time the component has been rendered. Note that the component does not automatically re-render after the completion of any returned Task, because that would cause an infinite render loop.

protected virtual void OnInitialized()

Method invoked when the component is ready to start, having received its initial parameters from its parent in the render tree.

protected virtual Task OnInitializedAsync()

Method invoked when the component is ready to start, having received its initial parameters from its parent in the render tree. Override this method if you will perform an asynchronous operation and want the component to refresh when that operation is completed.

protected virtual void OnParametersSet()

Method invoked when the component has received parameters from its parent in the render tree, and the incoming values have been assigned to properties.

protected virtual Task OnParametersSetAsync()

Method invoked when the component has received parameters from its parent in the render tree, and the incoming values have been assigned to properties.

public virtual Task SetParametersAsync(ParameterView parameters)

Sets parameters supplied by the component's parent in the render tree.

protected virtual bool ShouldRender()

Returns a flag to indicate whether the component should render.

protected void StateHasChanged()

Notifies the component that its state has changed. When applicable, this will cause the component to be re-rendered.