Class RenderMudNumericFieldAttribute
This class is an attribute that, when applied to a numeric property, causes the form generator to render the property as a MudBlazor.MudNumericField`1 component.
Inheritance
Inherited Members
Namespace: CG.Blazor.Forms.Attributes
Assembly: CG.Blazor.Forms._MudBlazor.dll
Syntax
[AttributeUsage(AttributeTargets.Property)]
public class RenderMudNumericFieldAttribute : MudBlazorAttribute
Remarks
This attribute is only valid when placed on a property of type: numeric, which means: byte, short, int, long, float, double, decimal.
Examples
Here is an example of decorating a model property to render a MudBlazor.MudNumericField`1:
using CG.Blazor.Forms.Attributes;
class MyModel
{
[RenderMudNumeric]
public int MyProperty { get;set; }
}
Constructors
RenderMudNumericFieldAttribute()
This constructor creates a new instance of the RenderMudNumericFieldAttribute class.
Declaration
public RenderMudNumericFieldAttribute()
Properties
Adornment
This property indicates the Start or End Adornment if not set to None.
Declaration
public Adornment Adornment { get; set; }
Property Value
Type | Description |
---|---|
MudBlazor.Adornment |
AdornmentColor
This property indicates the color of the adornment if used. It supports the theme colors.
Declaration
public Color AdornmentColor { get; set; }
Property Value
Type | Description |
---|---|
MudBlazor.Color |
AdornmentIcon
This property indicates the icon that will be used if Adornment is set to Start or End.
Declaration
public string AdornmentIcon { get; set; }
Property Value
Type | Description |
---|---|
System.String |
AdornmentText
This property indicates the text that will be used if Adornment is set to Start or End, the Text overrides Icon.
Declaration
public string AdornmentText { get; set; }
Property Value
Type | Description |
---|---|
System.String |
AutoFocus
This property, If true, will force the input focus automatically
Declaration
public bool AutoFocus { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
DebounceInterval
This property indicates the interval to be awaited in milliseconds before changing the Text value
Declaration
public int DebounceInterval { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Disabled
This property, if true, the input element will be disabled.
Declaration
public bool Disabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
DisableUnderLine
This property, if true, the input will not have an underline.
Declaration
public bool DisableUnderLine { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Format
This property contains a conversion format value for ToString(), can be used for formatting primitive types, DateTimes and TimeSpans
Declaration
public string Format { get; set; }
Property Value
Type | Description |
---|---|
System.String |
FullWidth
This property, if true, will force the input to take up the full width of its container.
Declaration
public bool FullWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
HideSpinButtons
This property, if true, hides the spin buttons, the user can still change value with keyboard arrows and manual update.
Declaration
public bool HideSpinButtons { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
IconSize
This property contains the icon size.
Declaration
public Size IconSize { get; set; }
Property Value
Type | Description |
---|---|
MudBlazor.Size |
Immediate
This property, If true, the input will update the Value immediately on typing. If false, the Value is updated only on Enter.
Declaration
public bool Immediate { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
InputMode
This property hints at the type of data that might be entered by the user while editing the input. Defaults to numeric
Declaration
public InputMode InputMode { get; set; }
Property Value
Type | Description |
---|---|
MudBlazor.InputMode |
Label
This property contains the label for the text field.
Declaration
public string Label { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Lines
This property indicates the number of lines to display.
Declaration
public int Lines { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Margin
This property, if true, will adjust the vertical spacing.
Declaration
public Margin Margin { get; set; }
Property Value
Type | Description |
---|---|
MudBlazor.Margin |
Max
This property indicates the maximum value for the input.
Declaration
public object Max { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
Min
This property indicates the minumum value for the input.
Declaration
public object Min { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
Pattern
This property, when specified, is a regular expression which the input's value must match in order for the value to pass constraint validation. It must be a valid JavaScript regular expression Defaults to[0 - 9,.-+]* To get a numerical keyboard on safari, use the pattern.The default pattern should achieve numerical keyboard.
Declaration
public string Pattern { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Placeholder
This property contains a short hint displayed in the input before the user enters a value.
Declaration
public string Placeholder { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ReadOnly
This property indicates whether the text field is read only, or not.
Declaration
public bool ReadOnly { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Step
This property contains the increment added/subtracted by the spin buttons.
Declaration
public object Step { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
Variant
This property contains the variant for the control.
Declaration
public Variant Variant { get; set; }
Property Value
Type | Description |
---|---|
MudBlazor.Variant |
Methods
Generate(RenderTreeBuilder, Int32, IHandleEvent, Stack<Object>, PropertyInfo, ILogger<IFormGenerator>)
Declaration
public override int Generate(RenderTreeBuilder builder, int index, IHandleEvent eventTarget, Stack<object> path, PropertyInfo prop, ILogger<IFormGenerator> logger)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder | builder | |
System.Int32 | index | |
Microsoft.AspNetCore.Components.IHandleEvent | eventTarget | |
System.Collections.Generic.Stack<System.Object> | path | |
System.Reflection.PropertyInfo | prop | |
Microsoft.Extensions.Logging.ILogger<CG.Blazor.Forms.Services.IFormGenerator> | logger |
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
ToAttributes()
Declaration
public override IDictionary<string, object> ToAttributes()
Returns
Type | Description |
---|---|
System.Collections.Generic.IDictionary<System.String, System.Object> |