Class MudPicker<T>
- Namespace
- MudBlazor
- Assembly
- MudBlazor.dll
Represents a common form component for selecting date, time, and color values.
public class MudPicker<T> : MudFormComponent<T, string>, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged, IFormComponent, IDisposable
Type Parameters
T
The type of value being chosen.
- Inheritance
-
MudPicker<T>
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
MudPicker()
Creates a new instance.
public MudPicker()
- See Also
MudPicker(Converter<T, string>)
protected MudPicker(Converter<T, string> converter)
Parameters
- See Also
Fields
_inputReference
protected MudTextField<string> _inputReference
Field Value
- See Also
_keyInterceptor
protected IKeyInterceptor _keyInterceptor
Field Value
- See Also
_mask
protected IMask _mask
Field Value
- See Also
Properties
ActionsClass
The CSS classes applied to the action buttons container.
[Parameter]
[Category("Picker appearance")]
public string ActionsClass { get; set; }
Property Value
Remarks
Multiple classes must be separated by a space.
- See Also
ActionsClassname
protected string ActionsClassname { get; }
Property Value
- See Also
Adornment
The location of the AdornmentIcon for the input.
[Parameter]
[Category("Behavior")]
public Adornment Adornment { get; set; }
Property Value
Remarks
Defaults to End.
- See Also
AdornmentAriaLabel
The aria-label
for the adornment.
[Parameter]
[Category("Appearance")]
public string AdornmentAriaLabel { get; set; }
Property Value
Remarks
Defaults to null
.
- See Also
AdornmentColor
The color of the AdornmentIcon.
[Parameter]
[Category("Appearance")]
public Color AdornmentColor { get; set; }
Property Value
Remarks
Defaults to Default.
- See Also
AdornmentIcon
The icon shown next to the text input.
[Parameter]
[Category("Behavior")]
public string AdornmentIcon { get; set; }
Property Value
Remarks
Defaults to Event.
- See Also
AnchorOrigin
The location the popover opens, relative to its container.
[Parameter]
[Category("Appearance")]
public Origin AnchorOrigin { get; set; }
Property Value
Remarks
Defaults to TopLeft.
- See Also
Clearable
Displays the Clear icon button.
[Parameter]
[Category("Behavior")]
public bool Clearable { get; set; }
Property Value
Remarks
Defaults to false
.
When true
, an icon is displayed which, when clicked, clears the Text and Value. Use the ClearIcon
property to control the Clear button icon.
- See Also
Color
The color of the toolbar, selected, and active values.
[Parameter]
[Category("Picker appearance")]
public Color Color { get; set; }
Property Value
Remarks
Defaults to Primary.
- See Also
Disabled
Prevents the user from interacting with this button.
[Parameter]
[Category("Behavior")]
public bool Disabled { get; set; }
Property Value
Remarks
Defaults to false
.
- See Also
Editable
Allows the value to be edited.
[Parameter]
[Category("Behavior")]
public bool Editable { get; set; }
Property Value
Remarks
Defaults to false
.
- See Also
Elevation
The size of the drop shadow.
[Parameter]
[Category("Picker appearance")]
public int Elevation { get; set; }
Property Value
Remarks
Defaults to 8
.
A higher number creates a heavier drop shadow. Use a value of 0
for no shadow.
- See Also
HelperText
The text displayed below the text field.
[Parameter]
[Category("Behavior")]
public string HelperText { get; set; }
Property Value
Remarks
This property is typically used to help the user understand what kind of input is allowed. The HelperTextOnFocus property controls when this text is visible.
- See Also
HelperTextOnFocus
Displays the HelperText only when this input has focus.
[Parameter]
[Category("Behavior")]
public bool HelperTextOnFocus { get; set; }
Property Value
Remarks
Defaults to false
.
- See Also
IconSize
The size of the icon in the input field.
[Parameter]
[Category("Appearance")]
public Size IconSize { get; set; }
Property Value
Remarks
Defaults to Medium.
- See Also
ImmediateText
[Parameter]
[Category("Behavior")]
public bool ImmediateText { get; set; }
Property Value
Remarks
Defaults to false
.
When false
, Text is only updated when pressing Enter
or upon loss of focus.
- See Also
InputContent
protected virtual RenderFragment InputContent { get; }
Property Value
- See Also
Label
The label for this input.
[Parameter]
[Category("Behavior")]
public string Label { get; set; }
Property Value
Remarks
If no value is specified, the label will be displayed in the input. Otherwise, it will be scaled down to the top of the input.
- See Also
Margin
Applies vertical spacing.
[Parameter]
[Category("Appearance")]
public Margin Margin { get; set; }
Property Value
- See Also
Mask
The mask to apply to input values when Editable is true
.
[Parameter]
[Category("Behavior")]
public IMask Mask { get; set; }
Property Value
- See Also
OnClick
Occurs when the text input has been clicked.
[Parameter]
public EventCallback<MouseEventArgs> OnClick { get; set; }
Property Value
- See Also
Open
protected bool Open { get; set; }
Property Value
- See Also
Orientation
The orientation of the picker when PickerVariant is Static.
[Parameter]
[Category("Picker appearance")]
public Orientation Orientation { get; set; }
Property Value
Remarks
Defaults to Portrait.
- See Also
OverflowBehavior
The behavior of the popover when it overflows its container.
[Parameter]
[Category("Appearance")]
public OverflowBehavior OverflowBehavior { get; set; }
Property Value
Remarks
Defaults to FlipOnOpen.
- See Also
PickerActions
The custom action buttons to display.
[Parameter]
[Category("Picker behavior")]
public RenderFragment<MudPicker<T>> PickerActions { get; set; }
Property Value
- See Also
PickerClassname
protected string PickerClassname { get; }
Property Value
- See Also
PickerClosed
Occurs when this picker has closed.
[Parameter]
public EventCallback PickerClosed { get; set; }
Property Value
- See Also
PickerContainerClassname
protected string PickerContainerClassname { get; }
Property Value
- See Also
PickerContent
protected virtual RenderFragment PickerContent { get; }
Property Value
- See Also
PickerInlineClassname
protected string PickerInlineClassname { get; }
Property Value
- See Also
PickerInputClassname
protected string PickerInputClassname { get; }
Property Value
- See Also
PickerOpened
Occurs when this picker has opened.
[Parameter]
public EventCallback PickerOpened { get; set; }
Property Value
- See Also
PickerPaperClassname
protected string PickerPaperClassname { get; }
Property Value
- See Also
PickerPaperStylename
protected string PickerPaperStylename { get; }
Property Value
- See Also
PickerVariant
The display variant for this picker.
[Parameter]
[Category("Behavior")]
public PickerVariant PickerVariant { get; set; }
Property Value
Remarks
- See Also
Placeholder
The text displayed in the input if no value is specified.
[Parameter]
[Category("Behavior")]
public string Placeholder { get; set; }
Property Value
Remarks
This property is typically used to give the user a hint as to what kind of input is expected.
- See Also
ReadOnly
Prevents the input from being changed by the user.
[Parameter]
[Category("Behavior")]
public bool ReadOnly { get; set; }
Property Value
Remarks
Defaults to false
.
When true
, the user can copy text in the control, but cannot change the value.
- See Also
Render
protected virtual RenderFragment Render { get; }
Property Value
- See Also
Rounded
Shows rounded corners.
[Parameter]
[Category("Picker appearance")]
public bool Rounded { get; set; }
Property Value
Remarks
Defaults to false
.
When true
, the border-radius
style is set to the theme's default value.
- See Also
ShowToolbar
Shows the toolbar.
[Parameter]
[Category("Picker appearance")]
public bool ShowToolbar { get; set; }
Property Value
Remarks
Defaults to true
.
- See Also
Square
Disables rounded corners.
[Parameter]
[Category("Picker appearance")]
public bool Square { get; set; }
Property Value
Remarks
Defaults to false
.
- See Also
Text
The currently selected value, as a string.
[Parameter]
[Category("Data")]
public string Text { get; set; }
Property Value
- See Also
TextChanged
Occurs when Text has changed.
[Parameter]
public EventCallback<string> TextChanged { get; set; }
Property Value
- See Also
ToolbarClass
The CSS classes for the toolbar when ShowToolbar is true
.
[Parameter]
[Category("Picker appearance")]
public string ToolbarClass { get; set; }
Property Value
Remarks
Multiple classes must be separated by spaces.
- See Also
TransformOrigin
The direction the popover opens, relative to its container.
[Parameter]
[Category("Appearance")]
public Origin TransformOrigin { get; set; }
Property Value
Remarks
Defaults to TopLeft.
- See Also
Underline
Shows an underline under the input text.
[Parameter]
[Category("Appearance")]
public bool Underline { get; set; }
Property Value
Remarks
Defaults to true
.
- See Also
Variant
The display variant of the text input.
[Parameter]
[Category("Appearance")]
public Variant Variant { get; set; }
Property Value
Remarks
Defaults to Text.
- See Also
Methods
BlurAsync()
Releases focus for the input.
public virtual ValueTask BlurAsync()
Returns
- See Also
BuildRenderTree(RenderTreeBuilder)
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
RenderTreeBuilder
- See Also
ClearAsync(bool)
Hides this picker.
public virtual Task ClearAsync(bool close = true)
Parameters
close
boolWhen
true
, the picker will be closed if PickerVariant is not Static.
Returns
- See Also
CloseAsync(bool)
Closes this picker.
public Task CloseAsync(bool submit = true)
Parameters
submit
boolWhen
true
, the value is committed.
Returns
- See Also
Dispose(bool)
protected override void Dispose(bool disposing)
Parameters
disposing
bool
- See Also
FocusAsync()
Focuses the input.
public virtual ValueTask FocusAsync()
Returns
- See Also
GetDisabledState()
protected bool GetDisabledState()
Returns
- See Also
GetReadOnlyState()
protected bool GetReadOnlyState()
Returns
- See Also
OnAfterRenderAsync(bool)
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
firstRender
bool
Returns
- See Also
OnClosedAsync()
protected virtual Task OnClosedAsync()
Returns
- See Also
OnHandleKeyDownAsync(KeyboardEventArgs)
protected virtual Task OnHandleKeyDownAsync(KeyboardEventArgs args)
Parameters
args
KeyboardEventArgs
Returns
- See Also
OnInitialized()
protected override void OnInitialized()
- See Also
OnOpenedAsync()
protected virtual Task OnOpenedAsync()
Returns
- See Also
OnPickerClosedAsync()
protected virtual Task OnPickerClosedAsync()
Returns
- See Also
OnPickerOpenedAsync()
protected virtual Task OnPickerOpenedAsync()
Returns
- See Also
OpenAsync()
Displays this picker.
public Task OpenAsync()
Returns
- See Also
ResetValueAsync()
protected override Task ResetValueAsync()
Returns
- See Also
SelectAsync()
Selects the input content.
public virtual ValueTask SelectAsync()
Returns
- See Also
SelectRangeAsync(int, int)
Selects a portion of the input content.
public virtual ValueTask SelectRangeAsync(int pos1, int pos2)
Parameters
pos1
intThe index of the first character to select.
pos2
intThe index of the last character to select.
Returns
- See Also
SetTextAsync(string, bool)
protected Task SetTextAsync(string value, bool callback)
Parameters
Returns
- See Also
StringValueChangedAsync(string)
Occurs when the string value has changed.
protected virtual Task StringValueChangedAsync(string value)
Parameters
value
string
Returns
- See Also
SubmitAsync()
protected virtual Task SubmitAsync()
Returns
- See Also
ToggleOpenAsync()
Opens or closes this picker.
public Task ToggleOpenAsync()
Returns
- See Also
ToggleStateAsync()
protected Task ToggleStateAsync()
Returns
- See Also