Table of Contents

Class RegisterParameterBuilder<T>

Namespace
MudBlazor.State.Builder
Assembly
MudBlazor.dll

Builder class for constructing instances of ParameterState<T>.

public class RegisterParameterBuilder<T>

Type Parameters

T

The type of the component's property value.

Inheritance
RegisterParameterBuilder<T>
Inherited Members
Extension Methods

Constructors

RegisterParameterBuilder()

Initializes a new instance of the RegisterParameterBuilder<T> class.

public RegisterParameterBuilder()

Methods

WithChangeHandler(IParameterChangedHandler<T>, string?)

Sets the parameter changed handler for the parameter.

public RegisterParameterBuilder<T> WithChangeHandler(IParameterChangedHandler<T> parameterChangedHandler, string? handlerName = null)

Parameters

parameterChangedHandler IParameterChangedHandler<T>

The parameter changed handler.

handlerName string

The handler's name. Do not set this value as it's set at compile-time through CallerArgumentExpressionAttribute.

Returns

RegisterParameterBuilder<T>

The current instance of the builder.

WithChangeHandler(Action, string?)

Sets the parameter changed handler for the parameter.

public RegisterParameterBuilder<T> WithChangeHandler(Action parameterChangedHandler, string? handlerName = null)

Parameters

parameterChangedHandler Action

The parameter changed handler.

handlerName string

The handler's name. Do not set this value as it's set at compile-time through CallerArgumentExpressionAttribute.

Returns

RegisterParameterBuilder<T>

The current instance of the builder.

WithChangeHandler(Action<ParameterChangedEventArgs<T>>, string?)

Sets the parameter changed handler for the parameter.

public RegisterParameterBuilder<T> WithChangeHandler(Action<ParameterChangedEventArgs<T>> parameterChangedHandler, string? handlerName = null)

Parameters

parameterChangedHandler Action<ParameterChangedEventArgs<T>>

The parameter changed handler.

handlerName string

The handler's name. Do not set this value as it's set at compile-time through CallerArgumentExpressionAttribute.

Returns

RegisterParameterBuilder<T>

The current instance of the builder.

WithChangeHandler(Func<ParameterChangedEventArgs<T>, Task>, string?)

Sets the parameter changed handler for the parameter.

public RegisterParameterBuilder<T> WithChangeHandler(Func<ParameterChangedEventArgs<T>, Task> parameterChangedHandler, string? handlerName = null)

Parameters

parameterChangedHandler Func<ParameterChangedEventArgs<T>, Task>

The parameter changed handler.

handlerName string

The handler's name. Do not set this value as it's set at compile-time through CallerArgumentExpressionAttribute.

Returns

RegisterParameterBuilder<T>

The current instance of the builder.

WithChangeHandler(Func<Task>, string?)

Sets the parameter changed handler for the parameter.

public RegisterParameterBuilder<T> WithChangeHandler(Func<Task> parameterChangedHandler, string? handlerName = null)

Parameters

parameterChangedHandler Func<Task>

The parameter changed handler.

handlerName string

The handler's name. Do not set this value as it's set at compile-time through CallerArgumentExpressionAttribute.

Returns

RegisterParameterBuilder<T>

The current instance of the builder.

WithComparer(IEqualityComparer<T>?)

Sets the comparer for the parameter.

public RegisterParameterBuilder<T> WithComparer(IEqualityComparer<T>? comparer)

Parameters

comparer IEqualityComparer<T>

The comparer for the parameter.

Returns

RegisterParameterBuilder<T>

The current instance of the builder.

Remarks

This method is used when you need to register a static IEqualityComparer<T> that doesn't change during ParameterState<T> lifespan.

WithComparer(Func<IEqualityComparer<T>>?, string?)

Sets the function to provide the comparer for the parameter.

public RegisterParameterBuilder<T> WithComparer(Func<IEqualityComparer<T>>? comparerFunc, string? comparerParameterName = null)

Parameters

comparerFunc Func<IEqualityComparer<T>>

The function to provide the comparer for the parameter.

comparerParameterName string

The parameter's comparer name. Do not set this value as it's set at compile-time through CallerArgumentExpressionAttribute.

Returns

RegisterParameterBuilder<T>

The current instance of the builder.

Remarks

This method should be used exclusively when the parameter has an associated IEqualityComparer<T> that is also declared as a Blazor ParameterAttribute.

WithComparer<TFrom>(Func<IEqualityComparer<TFrom>>, Func<IEqualityComparer<TFrom>, IEqualityComparer<T>>, string?)

Sets the function to provide the comparer for the parameter, converting it to a comparer of type T.

public RegisterParameterBuilder<T> WithComparer<TFrom>(Func<IEqualityComparer<TFrom>> comparerFromFunc, Func<IEqualityComparer<TFrom>, IEqualityComparer<T>> comparerToFunc, string? comparerParameterName = null)

Parameters

comparerFromFunc Func<IEqualityComparer<TFrom>>

The function to provide the original comparer.

comparerToFunc Func<IEqualityComparer<TFrom>, IEqualityComparer<T>>

The function to convert the original comparer to a comparer of type T.

comparerParameterName string

The parameter's comparer name. Do not set this value as it's set at compile-time through CallerArgumentExpressionAttribute.

Returns

RegisterParameterBuilder<T>

The current instance of the builder.

Type Parameters

TFrom

The type of the original comparer.

WithEventCallback(Func<EventCallback<T>>)

Sets the function to create the event callback for the parameter.

public RegisterParameterBuilder<T> WithEventCallback(Func<EventCallback<T>> eventCallbackFunc)

Parameters

eventCallbackFunc Func<EventCallback<T>>

The function to create the event callback.

Returns

RegisterParameterBuilder<T>

The current instance of the builder.

WithName(string)

Sets the metadata for the parameter.

public RegisterParameterBuilder<T> WithName(string parameterName)

Parameters

parameterName string

The name of the parameter, passed using nameof(...).

Returns

RegisterParameterBuilder<T>

The current instance of the builder.

WithParameter(Func<T>)

Sets the function to get the parameter value.

public RegisterParameterBuilder<T> WithParameter(Func<T> getParameterValueFunc)

Parameters

getParameterValueFunc Func<T>

The function to get the parameter value.

Returns

RegisterParameterBuilder<T>

The current instance of the builder.

Operators

implicit operator ParameterState<T>(RegisterParameterBuilder<T>)

Implicitly converts a RegisterParameterBuilder<T> object to a ParameterState<T> object by building it.

public static implicit operator ParameterState<T>(RegisterParameterBuilder<T> builder)

Parameters

builder RegisterParameterBuilder<T>

The RegisterParameterBuilder<T> object to convert.

Returns

ParameterState<T>

The created ParameterState<T> object.