Class BOBDropdownContainer<TValue>
- Namespace
- BlazOrbit.Components.Forms.Dropdown
- Assembly
- BlazOrbit.dll
public class BOBDropdownContainer<TValue> : BOBInputComponentBase<TValue, BOBDropdownContainer<TValue>, BOBInputVariant>, IHasReadOnly, IHasDisabled, IHasRequired, IHasError, IVariantComponent<BOBInputVariant>, IVariantComponent, IHasSize, IHasLoading, IHasShadow, IHasElevation, IHasColor, IHasBackgroundColor, IHasPrefix, IHasSuffix, IInputFamilyComponent
Type Parameters
TValue
- Inheritance
-
objectComponentBaseInputBase<TValue>BOBInputComponentBase<TValue>BOBDropdownContainer<TValue>
- Implements
- Inherited Members
Constructors
BOBDropdownContainer()
public BOBDropdownContainer()
Properties
AriaMultiselectable
When true, advertises the menu as multi-selectable to assistive tech.
[Parameter]
public bool AriaMultiselectable { get; set; }
Property Value
- bool
AriaRole
ARIA role applied to the popup menu (defaults to listbox; use tree or menu for non-list semantics).
[Parameter]
public string AriaRole { get; set; }
Property Value
- string
BackgroundColor
Background color of the trigger. Accepts any valid CSS color value.
[Parameter]
public string? BackgroundColor { get; set; }
Property Value
- string
BuiltInTemplates
protected override IReadOnlyDictionary<BOBInputVariant, Func<BOBDropdownContainer<TValue>, RenderFragment>> BuiltInTemplates { get; }
Property Value
- IReadOnlyDictionary<BOBInputVariant, Func<BOBDropdownContainer<TValue>, RenderFragment>>
Color
Text color of the trigger. Accepts any valid CSS color value.
[Parameter]
public string? Color { get; set; }
Property Value
- string
ComponentId
public string ComponentId { get; }
Property Value
- string
DefaultVariant
Default variant used when no explicit variant is specified.
public override BOBInputVariant DefaultVariant { get; }
Property Value
DisplayValue
[Parameter]
[EditorRequired]
public string DisplayValue { get; set; }
Property Value
- string
Elevation
Material Design elevation level (0–24) applied to the menu surface. Sets a derived shadow and lifts the surface in dark mode via a tint overlay. Overridden by Shadow.
[Parameter]
public int? Elevation { get; set; }
Property Value
- int?
HasValue
When true, HasValue is active.
[Parameter]
public bool HasValue { get; set; }
Property Value
- bool
HelperText
Helper text displayed below the component for additional context.
[Parameter]
public string? HelperText { get; set; }
Property Value
- string
IsOpen
public bool IsOpen { get; }
Property Value
- bool
Label
Floating label displayed above the component.
[Parameter]
public string? Label { get; set; }
Property Value
- string
Loading
When true, the trigger shows a loading indicator and ignores activation.
[Parameter]
public bool Loading { get; set; }
Property Value
- bool
LoadingIndicatorVariant
[Parameter]
public BOBLoadingIndicatorVariant LoadingIndicatorVariant { get; set; }
Property Value
MenuContent
Render fragment that emits the popup menu content (option list, tree, etc.).
[Parameter]
public RenderFragment? MenuContent { get; set; }
Property Value
- RenderFragment
OnClosed
Raised when the Closed event occurs.
[Parameter]
public EventCallback OnClosed { get; set; }
Property Value
- EventCallback
OnKeyboardNavigation
Raised when the KeyboardNavigation event occurs.
[Parameter]
public EventCallback<DropdownKeyboardEventArgs> OnKeyboardNavigation { get; set; }
Property Value
- EventCallback<DropdownKeyboardEventArgs>
OnOpened
Raised when the Opened event occurs.
[Parameter]
public EventCallback OnOpened { get; set; }
Property Value
- EventCallback
OnValueChanged
Raised when the ValueChanged event occurs.
[Parameter]
public EventCallback<TValue> OnValueChanged { get; set; }
Property Value
- EventCallback<TValue>
Placeholder
Placeholder text shown when the component is empty.
[Parameter]
public string? Placeholder { get; set; }
Property Value
- string
Placement
Preferred placement of the popup menu relative to the trigger.
[Parameter]
public DropdownPlacement Placement { get; set; }
Property Value
PrefixBackgroundColor
PrefixBackground color. Accepts any valid CSS color value.
[Parameter]
public string? PrefixBackgroundColor { get; set; }
Property Value
- string
PrefixColor
Prefix color. Accepts any valid CSS color value.
[Parameter]
public string? PrefixColor { get; set; }
Property Value
- string
PrefixIcon
Material icon name for the Prefix.
[Parameter]
public IconKey? PrefixIcon { get; set; }
Property Value
PrefixText
Text displayed before the trigger value.
[Parameter]
public string? PrefixText { get; set; }
Property Value
- string
Shadow
Shadow style applied to the trigger container. Wins over Elevation when both are set.
[Parameter]
public ShadowStyle? Shadow { get; set; }
Property Value
Size
Visual size of the dropdown trigger.
[Parameter]
public BOBSize Size { get; set; }
Property Value
SuffixBackgroundColor
SuffixBackground color. Accepts any valid CSS color value.
[Parameter]
public string? SuffixBackgroundColor { get; set; }
Property Value
- string
SuffixColor
Suffix color. Accepts any valid CSS color value.
[Parameter]
public string? SuffixColor { get; set; }
Property Value
- string
SuffixIcon
Material icon name for the Suffix.
[Parameter]
public IconKey? SuffixIcon { get; set; }
Property Value
SuffixText
Text displayed after the trigger value.
[Parameter]
public string? SuffixText { get; set; }
Property Value
- string
Methods
BuildComponentDataAttributes(Dictionary<string, object>)
public override void BuildComponentDataAttributes(Dictionary<string, object> dataAttributes)
Parameters
dataAttributesDictionary<string, object>
BuildRenderTree(RenderTreeBuilder)
Renders the component to the supplied Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builderRenderTreeBuilder
CloseAsync()
public Task CloseAsync()
Returns
- Task
DisposeAsync()
Async disposal path. Blazor invokes this first when the component is unmounted because the type implements System.IAsyncDisposable; it tears down the JS-side behavior instance via BlazOrbit.Abstractions.BOBComponentPipeline.DisposeBehaviorAsync().
public override ValueTask DisposeAsync()
Returns
- ValueTask
Remarks
Both this method and Dispose(bool) run on disposal — Blazor calls
DisposeAsync for the async work and the framework's System.IDisposable
contract still invokes Dispose(true) afterward. The split is intentional:
async work (JS interop teardown) lives here, sync work (event unsubscribe) lives in
Dispose(true). Both set IsDisposed so derived components can
guard post-await continuations regardless of which path runs first.
FocusSearchInputAsync()
public Task FocusSearchInputAsync()
Returns
- Task
OnAfterRenderAsync(bool)
Method invoked after each time the component has been rendered interactively and the UI has finished updating (for example, after elements have been added to the browser DOM). Any Microsoft.AspNetCore.Components.ElementReference fields will be populated by the time this runs.
This method is not invoked during prerendering or server-side rendering, because those processes are not attached to any live browser DOM and are already complete before the DOM is updated.
Note that the component does not automatically re-render after the completion of any returned System.Threading.Tasks.Task, because that would cause an infinite render loop.
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
firstRenderboolSet to
trueif this is the first time Microsoft.AspNetCore.Components.ComponentBase.OnAfterRender(bool) has been invoked on this component instance; otherwisefalse.
Returns
- Task
A System.Threading.Tasks.Task representing any asynchronous operation.
Remarks
The Microsoft.AspNetCore.Components.ComponentBase.OnAfterRender(bool) and Microsoft.AspNetCore.Components.ComponentBase.OnAfterRenderAsync(bool) lifecycle methods
are useful for performing interop, or interacting with values received from @ref.
Use the firstRender parameter to ensure that initialization work is only performed
once.
OpenAsync()
public Task OpenAsync()
Returns
- Task
ToggleAsync()
public Task ToggleAsync()
Returns
- Task
TryParseValueFromString(string?, out TValue, out string)
Parses a string to create an instance of TValue. Derived classes can override this to change how
Microsoft.AspNetCore.Components.Forms.InputBase<TValue>.CurrentValueAsString interprets incoming values.
protected override bool TryParseValueFromString(string? value, out TValue result, out string validationErrorMessage)
Parameters
valuestringThe string value to be parsed.
resultTValueAn instance of
TValue.validationErrorMessagestringIf the value could not be parsed, provides a validation error message.
Returns
- bool
True if the value could be parsed; otherwise false.