Class RenderMudCheckBoxAttribute
This class is an attribute that, when applied to a bool property, causes the form generator to render the property as a MudBlazor.MudCheckBox`1 component.
Inheritance
Inherited Members
Namespace: CG.Blazor.Forms.Attributes
Assembly: CG.Blazor.Forms._MudBlazor.dll
Syntax
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public class RenderMudCheckBoxAttribute : 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.MudCheckBox`1:
using CG.Blazor.Forms.Attributes;
class MyModel
{
[RenderMudCheckBox]
public bool MyProperty { get;set; }
}
Constructors
RenderMudCheckBoxAttribute()
This constructor creates a new instance of the RenderMudCheckBoxAttribute class.
Declaration
public RenderMudCheckBoxAttribute()
Properties
CheckedIcon
This property contains a custom checked icon, leave null for default.
Declaration
public string CheckedIcon { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Color
This property indicates the color of the component. It supports the theme colors.
Declaration
public Color Color { get; set; }
Property Value
Type | Description |
---|---|
MudBlazor.Color |
Dense
This proerty, if true, causes compact padding to be applied.
Declaration
public bool Dense { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Disabled
This property, if true, the input will be disabled.
Declaration
public bool Disabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
DisableRipple
This property, if true, disables ripple effect.
Declaration
public bool DisableRipple { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
IndeterminateIcon
This property contains a custom indeterminate icon, leave null for default.
Declaration
public string IndeterminateIcon { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Label
This property contains an optional label for the text field.
Declaration
public string Label { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ReadOnly
This property, if true, the input will be read-only.
Declaration
public bool ReadOnly { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Size
This property cotnains the size of the component.
Declaration
public Size Size { get; set; }
Property Value
Type | Description |
---|---|
MudBlazor.Size |
TriState
This property indicates if the checkbox can cycle again through indeterminate status.
Declaration
public bool TriState { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
UncheckedIcon
This property contains a custom unchecked icon, leave null for default.
Declaration
public string UncheckedIcon { get; set; }
Property Value
Type | Description |
---|---|
System.String |
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> |