Class MBNumericDecimalField
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
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
Density
The numeric field's density.
[Parameter]
public MBDensity? Density { get; set; }
Property Value
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
HelperText
Helper text that is displayed either with focus or persistently with HelperTextPersistent.
[Parameter]
public string HelperText { get; set; }
Property Value
HelperTextPersistent
Makes the HelperText persistent if true.
[Parameter]
public bool HelperTextPersistent { get; set; }
Property Value
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
Label
Field label.
[Parameter]
public string? Label { get; set; }
Property Value
LeadingIcon
The leading icon's name. No leading icon shown if not set.
[Parameter]
public string? LeadingIcon { get; set; }
Property Value
Max
The maximum allowable value.
[Parameter]
public decimal? Max { get; set; }
Property Value
Min
The minimum allowable value.
[Parameter]
public decimal? Min { get; set; }
Property Value
NumericFormat
Format to apply to the numeric value when the field is not selected.
[Parameter]
public string NumericFormat { get; set; }
Property Value
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
Prefix
Prefix text.
[Parameter]
public string? Prefix { get; set; }
Property Value
Suffix
Suffix text.
[Parameter]
public string? Suffix { get; set; }
Property Value
TextInputStyle
The text input style.
Overrides TextInputStyle
[Parameter]
public MBTextInputStyle? TextInputStyle { get; set; }
Property Value
TrailingIcon
The trailing icon's name. No leading icon shown if not set.
[Parameter]
public string? TrailingIcon { get; set; }
Property Value
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
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
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
OnInitializedAsync()
protected override Task OnInitializedAsync()