Class SingleSelectComponent<T, TListElement>
A DRY inspired abstract class providing MBSelect<TItem> and MBRadioButtonGroup<TItem> with validation.
Implements
Inherited Members
Namespace: Material.Blazor.Internal
Assembly: Material.Blazor.dll
Syntax
public abstract class SingleSelectComponent<T, TListElement> : InputComponent<T>, IDisposable where TListElement : MBSelectElement<T>
Type Parameters
Name | Description |
---|---|
T | |
TListElement |
Properties
| Improve this Doc View SourceGetKeysFunc
A function delegate to return the parameters for @key
attributes. If unused
"fake" keys set to GUIDs will be used.
Declaration
public Func<T, object> GetKeysFunc { get; set; }
Property Value
Type | Description |
---|---|
Func<T, Object> |
Items
The item list to be represented as radio buttons
Declaration
public IEnumerable<TListElement> Items { get; set; }
Property Value
Type | Description |
---|---|
IEnumerable<TListElement> |
ItemValidation
The form of validation to apply when Value is first set, deciding whether to accept a value outside the Items list, replace it with the first list item or to throw an exception (the default).
Overrides ItemValidation
Declaration
public MBItemValidation? ItemValidation { get; set; }
Property Value
Type | Description |
---|---|
Nullable<MBItemValidation> |
Methods
| Improve this Doc View SourceValidateItemList(IEnumerable<MBSelectElement<T>>, MBItemValidation)
Validates the item list against the validation specification.
Declaration
public (bool hasValue, T value) ValidateItemList(IEnumerable<MBSelectElement<T>> items, MBItemValidation appliedItemValidation)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<MBSelectElement<T>> | items | The item list |
MBItemValidation | appliedItemValidation | Specification of the required validation MBItemValidation |
Returns
Type | Description |
---|---|
(T1, T2)<Boolean, T> | The an indicator of whether an item was found and the item in the list matching Material.Blazor.Internal.InputComponent`1._cachedValue or default if not found. |
Exceptions
Type | Condition |
---|---|
ArgumentException |