Class RenderMudColorPickerAttribute
This class is an attribute that, when applied to a System.String property, causes the form generator to render the property as a MudBlazor.MudColorPicker component.
Inheritance
Inherited Members
Namespace: CG.Blazor.Forms.Attributes
Assembly: CG.Blazor.Forms._MudBlazor.dll
Syntax
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public class RenderMudColorPickerAttribute : MudBlazorAttribute
Remarks
This attribute is only valid when placed on a property of type: System.String
Examples
Here is an example of decorating a model property to render a MudBlazor.MudColorPicker:
using CG.Blazor.Forms.Attributes;
class MyModel
{
[RenderMudColorPicker]
public string MyProperty { get;set; }
}
Constructors
RenderMudColorPickerAttribute()
This constructor creates a new instance of the RenderMudColorPickerAttribute class.
Declaration
public RenderMudColorPickerAttribute()
Properties
Adornment
This property indicates the position for the control.
Declaration
public Adornment Adornment { get; set; }
Property Value
Type | Description |
---|---|
MudBlazor.Adornment |
AdornmentColor
This property indicates the color for the control.
Declaration
public Color AdornmentColor { get; set; }
Property Value
Type | Description |
---|---|
MudBlazor.Color |
AdornmentIcon
This property indicates the icon for the control.
Declaration
public string AdornmentIcon { get; set; }
Property Value
Type | Description |
---|---|
System.String |
AllowKeyboardInput
This property indicates whether the control accepts keyboard input, or not.
Declaration
public bool AllowKeyboardInput { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
ClassActions
This property contains any CSS classes to use for the action buttons.
Declaration
public string ClassActions { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Color
This property contains the color to use for the control.
Declaration
public Color Color { get; set; }
Property Value
Type | Description |
---|---|
MudBlazor.Color |
ColorPickerMode
This property contains the inital mode (RGB, HSL or HEX) with which the picker should open. Defaults to RGB
Declaration
public ColorPickerMode ColorPickerMode { get; set; }
Property Value
Type | Description |
---|---|
MudBlazor.ColorPickerMode |
ColorPickerView
This property contains the inital view of the picker. Views can be changed if toolbar is enabled.
Declaration
public ColorPickerView ColorPickerView { get; set; }
Property Value
Type | Description |
---|---|
MudBlazor.ColorPickerView |
DisableAlpha
This property indicates whether alpha options will be displayed, or not.
Declaration
public bool DisableAlpha { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
DisableColorField
This property indicates whether the color field will be displayed, or not.
Declaration
public bool DisableColorField { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Disabled
This property indicates whether the control is disabled, or not.
Declaration
public bool Disabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
DisableDragEffect
This property indicates whether the drag effect is disabled, or not.
Declaration
public bool DisableDragEffect { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
DisableInputs
This property indicates whether the text field inputs and color mode switch will be displayed, or not.
Declaration
public bool DisableInputs { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
DisableModeSwitch
This property indicates whether the switch to change color mode will be displayed, or not.
Declaration
public bool DisableModeSwitch { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
DisablePreview
This property indicates whether the preview color box will be displayed, or not. note that the preview color functions as a button as well for collection colors.
Declaration
public bool DisablePreview { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
DisableSliders
This property indicates whether the sliders will be displayed, or not.
Declaration
public bool DisableSliders { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
DisableToolbar
This property indicates whether the toolbar is disabled, or not.
Declaration
public bool DisableToolbar { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Editable
This property indicates whether the control is editable, or not.
Declaration
public bool Editable { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Elevation
This property contains the elevation to use for the control.
Declaration
public int Elevation { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
IconSize
This property indicates the icon size to use with the control.
Declaration
public Size IconSize { get; set; }
Property Value
Type | Description |
---|---|
MudBlazor.Size |
Label
This property contains a label for the control.
Declaration
public string Label { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Margin
This property contains the margin for the control.
Declaration
public Margin Margin { get; set; }
Property Value
Type | Description |
---|---|
MudBlazor.Margin |
Orientation
This property contains the orientiation for the control.
Declaration
public Orientation Orientation { get; set; }
Property Value
Type | Description |
---|---|
MudBlazor.Orientation |
Palette
This property contains a comma separated list of colors for the control's color pallette.
Declaration
public string Palette { get; set; }
Property Value
Type | Description |
---|---|
System.String |
PickerVariant
This property contains the control container variant.
Declaration
public PickerVariant PickerVariant { get; set; }
Property Value
Type | Description |
---|---|
MudBlazor.PickerVariant |
ReadOnly
This property indicates whether the control is read only, or not.
Declaration
public bool ReadOnly { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Required
This property indicates whether the control is required, or not.
Declaration
public bool Required { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Rounded
This property indicates whether the control should have rounded corners, or not.
Declaration
public bool Rounded { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Square
This property indicates whether the control should show square corners, or not.
Declaration
public bool Square { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
ToolBarClass
This property contains user class names for picker's ToolBar, separated by space
Declaration
public string ToolBarClass { get; set; }
Property Value
Type | Description |
---|---|
System.String |
UpdateBindingIfOnlyHSLChanged
This property indicates whether binding changes occure also when HSL values changed without a corresponding RGB change
Declaration
public bool UpdateBindingIfOnlyHSLChanged { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Variant
This property contains the variant for 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> |