Table of Contents

Class ConditionalCssClasses

Namespace
Material.Blazor.Internal
Assembly
Material.Blazor.dll

This is a helper class to conditionally apply CSS classes to an HTML element. Classes are added with the "AddIf(string, Func(bool))" method. From "ToString()" just the classes satisfying the condition are returned, joined into one string.

public class ConditionalCssClasses
Inheritance
ConditionalCssClasses
Inherited Members

Constructors

ConditionalCssClasses()

public ConditionalCssClasses()

Methods

AddIf(string, Func<bool>)

Adds a CSS class, whenever the "func" method returns true.

public ConditionalCssClasses AddIf(string name, Func<bool> func)

Parameters

name string

The string to be conditionally returned

func Func<bool>

The function to be executed to determine if the string is included

Returns

ConditionalCssClasses

The instance of the class

ToString()

Executes the defined functions, returning a concatenation of the results separated by a space

public override string ToString()

Returns

string

string