ComponentBase ComponentBase ComponentBase ComponentBase Class

Definition

Optional base class for components. Alternatively, components may implement IComponent directly.

public ref class ComponentBase abstract : Microsoft::AspNetCore::Components::IComponent, Microsoft::AspNetCore::Components::IHandleAfterRender, Microsoft::AspNetCore::Components::IHandleEvent
public abstract class ComponentBase : Microsoft.AspNetCore.Components.IComponent, Microsoft.AspNetCore.Components.IHandleAfterRender, Microsoft.AspNetCore.Components.IHandleEvent
type ComponentBase = class
    interface IComponent
    interface IHandleAfterRender
    interface IHandleEvent
Public MustInherit Class ComponentBase
Implements IComponent, IHandleAfterRender, IHandleEvent
Inheritance
ComponentBaseComponentBaseComponentBaseComponentBase
Derived
Implements

Constructors

ComponentBase() ComponentBase() ComponentBase() ComponentBase()

Constructs an instance of ComponentBase.

Methods

BuildRenderTree(RenderTreeBuilder) BuildRenderTree(RenderTreeBuilder) BuildRenderTree(RenderTreeBuilder) BuildRenderTree(RenderTreeBuilder)

Renders the component to the supplied RenderTreeBuilder.

InvokeAsync(Action) InvokeAsync(Action) InvokeAsync(Action) InvokeAsync(Action)

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

InvokeAsync(Func<Task>) InvokeAsync(Func<Task>) InvokeAsync(Func<Task>) InvokeAsync(Func<Task>)

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

OnAfterRender(Boolean) OnAfterRender(Boolean) OnAfterRender(Boolean) OnAfterRender(Boolean)

Method invoked after each time the component has been rendered.

OnAfterRenderAsync(Boolean) OnAfterRenderAsync(Boolean) OnAfterRenderAsync(Boolean) OnAfterRenderAsync(Boolean)

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.

OnInitialized() OnInitialized() OnInitialized() OnInitialized()

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

OnInitializedAsync() OnInitializedAsync() OnInitializedAsync() 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.

OnParametersSet() OnParametersSet() OnParametersSet() 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.

OnParametersSetAsync() OnParametersSetAsync() OnParametersSetAsync() 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.

SetParametersAsync(ParameterView) SetParametersAsync(ParameterView) SetParametersAsync(ParameterView) SetParametersAsync(ParameterView)

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

ShouldRender() ShouldRender() ShouldRender() ShouldRender()

Returns a flag to indicate whether the component should render.

StateHasChanged() StateHasChanged() StateHasChanged() StateHasChanged()

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

Explicit Interface Implementations

IComponent.Attach(RenderHandle) IComponent.Attach(RenderHandle) IComponent.Attach(RenderHandle) IComponent.Attach(RenderHandle)
IHandleAfterRender.OnAfterRenderAsync() IHandleAfterRender.OnAfterRenderAsync() IHandleAfterRender.OnAfterRenderAsync() IHandleAfterRender.OnAfterRenderAsync()
IHandleEvent.HandleEventAsync(EventCallbackWorkItem, Object) IHandleEvent.HandleEventAsync(EventCallbackWorkItem, Object) IHandleEvent.HandleEventAsync(EventCallbackWorkItem, Object) IHandleEvent.HandleEventAsync(EventCallbackWorkItem, Object)

Applies to