Class RenderMudFieldAttribute
This class is an attribute that, when applied to a DateTime property, causes the form generator to render the property as a MudBlazor.MudField component.
Inheritance
Inherited Members
Namespace: CG.Blazor.Forms.Attributes
Assembly: CG.Blazor.Forms._MudBlazor.dll
Syntax
[AttributeUsage(AttributeTargets.Property)]
public class RenderMudFieldAttribute : MudBlazorAttribute
Remarks
This attribute is only valid when placed on a property of type: DateTime.
Examples
Here is an example of decorating a model property to render a MudBlazor.MudField:
using CG.Blazor.Forms.Attributes;
class MyModel
{
[RenderMudField]
public string MyProperty { get;set; }
}
Constructors
RenderMudFieldAttribute()
This constructor creates a new instance of the RenderMudFieldAttribute class.
Declaration
public RenderMudFieldAttribute()
Properties
Adornment
This property contains the Start or End Adornment if not set to None.
Declaration
public Adornment Adornment { get; set; }
Property Value
Type | Description |
---|---|
MudBlazor.Adornment |
AdornmentIcon
This property contains 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 contains 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 |
Disabled
This property indicates whether the inpur element is disabled, or not.
Declaration
public bool Disabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
DisableUnderLine
This property indicates whether the input will have an underline, or not.
Declaration
public bool DisableUnderLine { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Format
This property contains the conversion format parameter 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 indicates whether the input will take up the full width of its container, or not.
Declaration
public bool FullWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
IconSize
This property indicates the icon size.
Declaration
public Size IconSize { get; set; }
Property Value
Type | Description |
---|---|
MudBlazor.Size |
Immediate
This property indicates whether the 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 |
InnerPadding
This property indicates the control should remove any inner padding.
Declaration
public bool InnerPadding { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Label
This property contains the label text will be displayed in the input, and scaled down at the top if the input has value.
Declaration
public string Label { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Margin
This property indicates how much to change the vertical spacing.
Declaration
public Margin Margin { get; set; }
Property Value
Type | Description |
---|---|
MudBlazor.Margin |
Variant
This property contains the variant to use with 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> |