Class ValueFieldBase<T>
public class ValueFieldBase<T> : FieldBase<IValue<T?>, IEntity?>, IComponent, IHandleEvent, IHandleAfterRender, IDisposable, IValidatable<IValue<T?>>, IValidatable
Type Parameters
T
- Inheritance
-
ValueFieldBase<T>
- Implements
-
IValidatable<IValue<T>>
- Derived
- Inherited Members
Properties
FocusChangedCallback
protected EventCallback<bool> FocusChangedCallback { get; }
Property Value
HasValue
Indicates whether the validatable field has a value set
public override bool HasValue { get; }
Property Value
Model
protected virtual T? Model { get; set; }
Property Value
- T
Parent
public override IEntity? Parent { get; }
Property Value
Methods
BindingValueChanged(object?, EventArgs)
protected virtual void BindingValueChanged(object? sender, EventArgs e)
Parameters
CanParse()
Indicates whether the validatable field has a value that can be parsed
public override bool CanParse()
Returns
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public override void Dispose()
HasChanges()
public override bool HasChanges()
Returns
OnAddValidationRules()
Called when the validation rules are added. This allows FieldBase implementations to override this method to provide validation rules at the field level (in addition to those passed in via the Rules parameter)
protected override void OnAddValidationRules()
OnAfterRender(bool)
Method invoked after each time the component has rendered interactively and the UI has finished updating (for example, after elements have been added to the browser DOM). Any 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.
protected override void OnAfterRender(bool firstRender)
Parameters
firstRenderboolSet to
trueif this is the first time OnAfterRender(bool) has been invoked on this component instance; otherwisefalse.
Remarks
The OnAfterRender(bool) and 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.
OnCanParseChanged(bool)
protected void OnCanParseChanged(bool canParse)
Parameters
canParsebool
OnParametersSet()
Method invoked when the component has received parameters from its parent in the render tree, and the incoming values have been assigned to properties.
protected override void OnParametersSet()
OnValidationChanged()
protected override void OnValidationChanged()
ShouldRender()
Returns a flag to indicate whether the component should render.
protected override bool ShouldRender()