Table of Contents

Class TwBlazorComponents

Namespace
TwBlazor.Configuration
Assembly
TwBlazor.dll

A type-keyed bag of component themes. Only add the component themes you want to customize - e.g. new() { new TwBlazorSliderTheme { ... }, new TwBlazorSidebarTheme { ... } } - and look them up by type with Get<TTheme>(). Consumers that don't find an entry for a given theme type fall back to that component's built-in default.

[ExcludeFromCodeCoverage]
public sealed class TwBlazorComponents : IEnumerable<object>, IEnumerable
Inheritance
TwBlazorComponents
Implements
Inherited Members

Constructors

TwBlazorComponents()

public TwBlazorComponents()

Methods

Add<TTheme>(TTheme)

public TwBlazorComponents Add<TTheme>(TTheme theme) where TTheme : class

Parameters

theme TTheme

Returns

TwBlazorComponents

Type Parameters

TTheme

Contains<TTheme>()

public bool Contains<TTheme>() where TTheme : class

Returns

bool

Type Parameters

TTheme

GetEnumerator()

public IEnumerator<object> GetEnumerator()

Returns

IEnumerator<object>

Get<TTheme>()

public TTheme? Get<TTheme>() where TTheme : class

Returns

TTheme

Type Parameters

TTheme

Require<TTheme>()

Gets the registered theme, or throws if it was never added via Add<TTheme>(TTheme). Use this from a component's theme lookup so a missing config fails loudly instead of silently rendering with no classes.

public TTheme Require<TTheme>() where TTheme : class

Returns

TTheme

Type Parameters

TTheme