Table of Contents

Class MBNumericDecimalField

Namespace
Material.Blazor
Assembly
Material.Blazor.dll

A Material Theme numeric input field. This wraps MBTextField and normally displays the numeric value as formatted text, but switches to a pure number on being selected.

public class MBNumericDecimalField : InputComponent<decimal>, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Inheritance
MBNumericDecimalField
Implements
Inherited Members

Constructors

MBNumericDecimalField()

public MBNumericDecimalField()

Properties

CultureInfo

The CultureInfo that determines the culture-specific format for numbers to the NumericFormat.

[Parameter]
public CultureInfo? CultureInfo { get; set; }

Property Value

CultureInfo

DecimalPlaces

Number of decimal places for the value. If more dp are entered the value gets rounded properly.

[Parameter]
public uint DecimalPlaces { get; set; }

Property Value

uint

Density

The numeric field's density.

[Parameter]
public MBDensity? Density { get; set; }

Property Value

MBDensity?

FocusedMagnitude

Adjusts the value's magnitude as a number when the field is focused. Used for percentages and basis points (the latter of which lacks appropriate Numeric Format in C#: this issue may not get solved.

[Parameter]
public MBNumericInputMagnitude FocusedMagnitude { get; set; }

Property Value

MBNumericInputMagnitude

HelperText

Helper text that is displayed either with focus or persistently with HelperTextPersistent.

[Parameter]
public string HelperText { get; set; }

Property Value

string

HelperTextPersistent

Makes the HelperText persistent if true.

[Parameter]
public bool HelperTextPersistent { get; set; }

Property Value

bool

IconFoundry

The foundry to use for both leading and trailing icons.

IconFoundry="IconHelper.MIIcon()"

IconFoundry="IconHelper.FAIcon()"

IconFoundry="IconHelper.OIIcon()"

Overrides IconFoundryName

[Parameter]
public IMBIconFoundry? IconFoundry { get; set; }

Property Value

IMBIconFoundry

Label

Field label.

[Parameter]
public string? Label { get; set; }

Property Value

string

LeadingIcon

The leading icon's name. No leading icon shown if not set.

[Parameter]
public string? LeadingIcon { get; set; }

Property Value

string

Max

The maximum allowable value.

[Parameter]
public decimal? Max { get; set; }

Property Value

decimal?

Min

The minimum allowable value.

[Parameter]
public decimal? Min { get; set; }

Property Value

decimal?

NumericFormat

Format to apply to the numeric value when the field is not selected.

[Parameter]
public string NumericFormat { get; set; }

Property Value

string

NumericSingularFormat

Alternative format for a singular number if required. An example is "1 month" vs "3 months".

[Parameter]
public string? NumericSingularFormat { get; set; }

Property Value

string

Prefix

Prefix text.

[Parameter]
public string? Prefix { get; set; }

Property Value

string

Suffix

Suffix text.

[Parameter]
public string? Suffix { get; set; }

Property Value

string

TextInputStyle

The text input style.

Overrides TextInputStyle

[Parameter]
public MBTextInputStyle? TextInputStyle { get; set; }

Property Value

MBTextInputStyle?

TrailingIcon

The trailing icon's name. No leading icon shown if not set.

[Parameter]
public string? TrailingIcon { get; set; }

Property Value

string

UnfocusedMagnitude

Adjusts the value's magnitude as a number when the field is unfocused. Used for percentages and basis points (the latter of which lacks appropriate Numeric Format in C#: this issue may not get solved.

[Parameter]
public MBNumericInputMagnitude UnfocusedMagnitude { get; set; }

Property Value

MBNumericInputMagnitude

ValidationMessageFor

Delivers Material Theme validation methods from native Blazor validation. Either use this or the Blazor

ValidationMessage
component, but not both. This parameter takes the same input as
ValidationMessage
's
For
parameter.
[Parameter]
public Expression<Func<object>> ValidationMessageFor { get; set; }

Property Value

Expression<Func<object>>

Methods

BuildRenderTree(RenderTreeBuilder)

Renders the component to the supplied RenderTreeBuilder.

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder

GetInputReference()

Returns an ElementReference for the control's input element.

public ElementReference GetInputReference()

Returns

ElementReference

OnInitializedAsync()

protected override Task OnInitializedAsync()

Returns

Task