Table of Contents

Interface IViewModelBase

Namespace
Blazing.Mvvm.ComponentModel
Assembly
Blazing.Mvvm.Base.dll

Represents a base interface for ViewModel classes in Blazing.Mvvm, supporting property change notification and lifecycle methods for Blazor Views.

public interface IViewModelBase : INotifyPropertyChanged, IDisposable

Implements

Methods

NotifyStateChanged()

Notifies the View that its state has changed and a UI update may be required.

void NotifyStateChanged()

OnAfterRender(bool)

Invoked when the View has been rendered.

void OnAfterRender(bool firstRender)

Parameters

firstRender bool

Set to true if this is the first time the view is rendered; otherwise, false.

OnAfterRenderAsync(bool)

Asynchronously invoked when the View has been rendered.

Task OnAfterRenderAsync(bool firstRender)

Parameters

firstRender bool

Set to true if this is the first time the view is rendered; otherwise, false.

Returns

Task

A Task representing the asynchronous operation.

OnInitialized()

Invoked when the View is initialized and has received its initial parameters.

void OnInitialized()

OnInitializedAsync()

Asynchronously invoked when the View is initialized and has received its initial parameters.

Task OnInitializedAsync()

Returns

Task

A Task representing the asynchronous operation.

OnParametersSet()

Invoked when the View has received parameters from its parent and parameter values have been set.

void OnParametersSet()

OnParametersSetAsync()

Asynchronously invoked when the View has received parameters from its parent and parameter values have been set.

Task OnParametersSetAsync()

Returns

Task

A Task representing the asynchronous operation.

ShouldRender()

Determines whether the View should render.

bool ShouldRender()

Returns

bool

true if the View should render; otherwise, false.