Class ValidatorViewModelBase
- Namespace
- Blazing.Mvvm.ComponentModel
- Assembly
- Blazing.Mvvm.Base.dll
Provides a base class for ViewModels that implement CommunityToolkit.Mvvm.ComponentModel.ObservableValidator, supporting validation and Blazor MVVM lifecycle integration. Implements IViewModelBase for property change notification and lifecycle methods.
public abstract class ValidatorViewModelBase : ObservableValidator, INotifyPropertyChanging, INotifyDataErrorInfo, IViewModelBase, INotifyPropertyChanged, IDisposableInheritance
Implements
Inherited Members
Constructors
ValidatorViewModelBase()
Initializes a new instance of the ValidatorViewModelBase class and subscribes to command property changes.
protected ValidatorViewModelBase()Methods
CommandPropertyChanged(object?, PropertyChangedEventArgs)
Handles property changes for subscribed CommunityToolkit.Mvvm.Input.IAsyncRelayCommand instances.
protected virtual void CommandPropertyChanged(object? sender, PropertyChangedEventArgs e)Parameters
senderobject?-
The command that raised the event.
ePropertyChangedEventArgs-
The event data.
Dispose(bool)
Releases the unmanaged resources used by the RecipientViewModelBase and optionally releases the managed resources.
protected virtual void Dispose(bool disposing)Parameters
disposingbool-
True to release both managed and unmanaged resources; false to release only unmanaged resources.
Dispose()
Disposes the ViewModel and releases resources.
public void Dispose()NotifyStateChanged()
Notifies the View that its state has changed and a UI update may be required.
public virtual void NotifyStateChanged()OnAfterRender(bool)
Invoked when the View has been rendered.
public virtual void OnAfterRender(bool firstRender)Parameters
OnAfterRenderAsync(bool)
Asynchronously invoked when the View has been rendered.
public virtual Task OnAfterRenderAsync(bool firstRender)Parameters
Returns
OnInitialized()
Invoked when the View is initialized and has received its initial parameters.
public virtual void OnInitialized()OnInitializedAsync()
Asynchronously invoked when the View is initialized and has received its initial parameters.
public virtual Task OnInitializedAsync()Returns
OnParametersSet()
Invoked when the View has received parameters from its parent and parameter values have been set.
public virtual void OnParametersSet()OnParametersSetAsync()
Asynchronously invoked when the View has received parameters from its parent and parameter values have been set.
public virtual Task OnParametersSetAsync()Returns
ShouldRender()
Determines whether the View should render.
public virtual bool ShouldRender()Returns
- bool
-
trueif theViewshould render; otherwise,false.