Class RenderMudAlertAttribute
This class is an attribute that, when applied to a string property, causes the form generator to render the property as a MudBlazor.MudAlert component.
Inheritance
Inherited Members
Namespace: CG.Blazor.Forms.Attributes
Assembly: CG.Blazor.Forms._MudBlazor.dll
Syntax
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public class RenderMudAlertAttribute : MudBlazorAttribute
Remarks
This attribute is only valid when placed on a property of type: string.
Examples
Here is an example of decorating a model property to render a MudBlazor.MudAlert:
using CG.Blazor.Forms.Attributes;
class MyModel
{
[RenderMudAlert]
public string MyProperty { get;set; }
}
Constructors
RenderMudAlertAttribute()
This constructor creates a new instance of the RenderMudAlertAttribute class.
Declaration
public RenderMudAlertAttribute()
Properties
AlertTextPosition
This property sets the position of the text to the start (Left in LTR and right in RTL).
Declaration
public AlertTextPosition AlertTextPosition { get; set; }
Property Value
Type | Description |
---|---|
MudBlazor.AlertTextPosition |
CloseIcon
This property defines the icon used for the close button.
Declaration
public string CloseIcon { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Dense
This property indicates, if true, compact padding will be used.
Declaration
public bool Dense { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Elevation
This property indicates the elevation. The higher the number, the heavier the drop-shadow. 0 for no shadow.
Declaration
public int Elevation { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Icon
This property indicates a custom icon, leave unset to use the standard icon which depends on the Severity
Declaration
public string Icon { get; set; }
Property Value
Type | Description |
---|---|
System.String |
NoIcon
This property indicates, if true, no alert icon will be used.
Declaration
public bool NoIcon { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Severity
This property indicates the severity of the alert. This defines the color and icon used.
Declaration
public Severity Severity { get; set; }
Property Value
Type | Description |
---|---|
MudBlazor.Severity |
ShowCloseIcon
This property indicates if the alert shows a close icon.
Declaration
public bool ShowCloseIcon { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Square
This property indicates, if true, rounded corners are disabled.
Declaration
public bool Square { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Variant
This property indicates the variant to use.
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> |