Table of Contents

Class BOBComponentBase

Namespace
BlazOrbit.Abstractions
Assembly
BlazOrbit.Core.dll
public abstract class BOBComponentBase : ComponentBase
Inheritance
object
ComponentBase
BOBComponentBase
Derived

Constructors

BOBComponentBase()

protected BOBComponentBase()

Properties

AdditionalAttributes

[Parameter(CaptureUnmatchedValues = true)]
public IReadOnlyDictionary<string, object>? AdditionalAttributes { get; set; }

Property Value

IReadOnlyDictionary<string, object>

ComputedAttributes

public Dictionary<string, object> ComputedAttributes { get; }

Property Value

Dictionary<string, object>

IsDisposed

true after DisposeAsync() has started. Derived components that subscribe to NavigationManager.LocationChanged, register children through cascading parameters, or hold a CancellationTokenSource must gate any post-await continuation on this flag before touching component state. Derived classes may set it eagerly at the top of their own override of DisposeAsync so that the rest of their teardown sees it as disposed.

protected bool IsDisposed { get; set; }

Property Value

bool

Methods

BuildComponentCssVariables(Dictionary<string, string>)

Override this method in derived components to add custom CSS variables. These will be merged with the standard behavior CSS variables. This method is called from BOBComponentAttributesBuilder during the style building process.

public virtual void BuildComponentCssVariables(Dictionary<string, string> cssVariables)

Parameters

cssVariables Dictionary<string, string>

Dictionary to add CSS variables to

BuildComponentDataAttributes(Dictionary<string, object>)

Override this method to add component-specific data attributes. Called during attribute building process.

public virtual void BuildComponentDataAttributes(Dictionary<string, object> dataAttributes)

Parameters

dataAttributes Dictionary<string, object>

BuildRenderTree(RenderTreeBuilder)

Renders the component to the supplied Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.

protected override void BuildRenderTree(RenderTreeBuilder builder)

Parameters

builder RenderTreeBuilder

A Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder that will receive the render output.

DisposeAsync()

public virtual ValueTask DisposeAsync()

Returns

ValueTask

OnAfterRenderAsync(bool)

Method invoked after each time the component has been rendered interactively and the UI has finished updating (for example, after elements have been added to the browser DOM). Any Microsoft.AspNetCore.Components.ElementReference fields will be populated by the time this runs.

This method is not invoked during prerendering or server-side rendering, because those processes are not attached to any live browser DOM and are already complete before the DOM is updated.

Note that the component does not automatically re-render after the completion of any returned System.Threading.Tasks.Task, because that would cause an infinite render loop.

protected override Task OnAfterRenderAsync(bool firstRender)

Parameters

firstRender bool

Set to true if this is the first time Microsoft.AspNetCore.Components.ComponentBase.OnAfterRender(bool) has been invoked on this component instance; otherwise false.

Returns

Task

A System.Threading.Tasks.Task representing any asynchronous operation.

Remarks

The Microsoft.AspNetCore.Components.ComponentBase.OnAfterRender(bool) and Microsoft.AspNetCore.Components.ComponentBase.OnAfterRenderAsync(bool) lifecycle methods are useful for performing interop, or interacting with values received from @ref. Use the firstRender parameter to ensure that initialization work is only performed once.

OnInitialized()

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

protected override void OnInitialized()

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 override void OnParametersSet()