Class RenderMudRadioGroupAttribute
This class is an attribute that, when applied to a string property, causes the form generator to render the property as a MudBlazor.MudRadioGroup`1 component.
Inheritance
Inherited Members
Namespace: CG.Blazor.Forms.Attributes
Assembly: CG.Blazor.Forms._MudBlazor.dll
Syntax
[AttributeUsage(AttributeTargets.Property)]
public class RenderMudRadioGroupAttribute : 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.MudRadioGroup`1:
using CG.Blazor.Forms.Attributes;
class MyModel
{
[RenderRadioGroup(Options = "1 2 3")]
public string MyProperty { get;set; }
}
Constructors
RenderMudRadioGroupAttribute()
This constructor creates a new instance of the RenderMudRadioGroupAttribute class.
Declaration
public RenderMudRadioGroupAttribute()
Properties
Colors
This property contains a comma separated list of colors for the radio buttons in the group.
Declaration
public string Colors { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Dense
This property indicates whether the radio buttons in the group should be dense, or not.
Declaration
public bool Dense { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Disabled
This property contains a comma separated list of disabled flags for the radio buttons in the group.
Declaration
public string Disabled { get; set; }
Property Value
Type | Description |
---|---|
System.String |
DisableRipple
This property indicates whether the radio buttons in the group should disable the ripple, or not.
Declaration
public bool DisableRipple { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Options
This property contains a comma separated list of options for the radio buttons in the group.
Declaration
public string Options { get; set; }
Property Value
Type | Description |
---|---|
System.String |
OptionsFunc
This property contains the name of an optional function, on either the top-level view-model, or the the associated model. That returns a list of strings, for options.
Declaration
public string OptionsFunc { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
The method should have this signature: IEnumerable{string} Func()
Placement
This property indicates the placement for the radio buttons in the group.
Declaration
public Placement Placement { get; set; }
Property Value
Type | Description |
---|---|
MudBlazor.Placement |
Size
This property indicates the size for the radio buttons in the group.
Declaration
public Size Size { get; set; }
Property Value
Type | Description |
---|---|
MudBlazor.Size |
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> |