Class BOBVariantComponentBase<TComponent, TVariant>
- Namespace
- BlazOrbit.Abstractions
- Assembly
- BlazOrbit.Core.dll
Variant-aware BOBComponentBase. Resolves the active variant template against BuiltInTemplates plus any external registrations.
public abstract class BOBVariantComponentBase<TComponent, TVariant> : BOBComponentBase, IVariantComponent<TVariant>, IVariantComponent where TComponent : BOBVariantComponentBase<TComponent, TVariant> where TVariant : Variant
Type Parameters
TComponentTVariant
- Inheritance
-
objectComponentBaseBOBVariantComponentBase<TComponent, TVariant>
- Implements
-
IVariantComponent<TVariant>
- Derived
- Inherited Members
Constructors
BOBVariantComponentBase()
protected BOBVariantComponentBase()
Properties
BuiltInTemplates
Compile-time map of variants to their built-in render templates.
protected abstract IReadOnlyDictionary<TVariant, Func<TComponent, RenderFragment>> BuiltInTemplates { get; }
Property Value
- IReadOnlyDictionary<TVariant, Func<TComponent, RenderFragment>>
CurrentVariant
Effective variant for this render (parameter or DefaultVariant).
public TVariant CurrentVariant { get; }
Property Value
- TVariant
DefaultVariant
Variant used when no Variant is supplied.
public abstract TVariant DefaultVariant { get; }
Property Value
- TVariant
Variant
Selected variant. null falls back to DefaultVariant.
[Parameter]
public TVariant? Variant { get; set; }
Property Value
- TVariant
Methods
BuildRenderTree(RenderTreeBuilder)
Renders the component to the supplied Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.
protected override void BuildRenderTree(RenderTreeBuilder builder)
Parameters
builderRenderTreeBuilderA Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder that will receive the render output.
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()