Class RenderMudSliderAttribute
This class is an attribute that, when applied to a numeric property, causes the form generator to render the property as a MudBlazor.MudSlider`1 component.
Inheritance
Inherited Members
Namespace: CG.Blazor.Forms.Attributes
Assembly: CG.Blazor.Forms._MudBlazor.dll
Syntax
[AttributeUsage(AttributeTargets.Property)]
public class RenderMudSliderAttribute : 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.MudSlider`1:
using CG.Blazor.Forms.Attributes;
class MyModel
{
[RenderMudSlider]
public float MyProperty { get;set; }
}
Constructors
RenderMudSliderAttribute()
This constructor creates a new instance of the RenderMudSliderAttribute class.
Declaration
public RenderMudSliderAttribute()
Properties
Color
This property indicates what color to use for the switch.
Declaration
public Color Color { get; set; }
Property Value
Type | Description |
---|---|
MudBlazor.Color |
Disabled
This property indicates whether the switch is disabled, or not.
Declaration
public bool Disabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Immediate
This property, if true, the dragging the slider will update the Value immediately. If false, the Value is updated only on releasing the handle.indicates whether to disable the ripple, or not.
Declaration
public bool Immediate { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Label
This property contains an optional label for the text field.
Declaration
public string Label { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Max
This property contains the maximum allowed value of the slider. Should not be equal to min.
Declaration
public object Max { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
Min
This property contains the minimum allowed value of the slider. Should not be equal to max.
Declaration
public object Min { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
Step
This property contains how many steps the slider should take on each move.
Declaration
public object Step { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
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> |