Table of Contents

Class AbstractMvvmComponentBase<T>

Namespace
Dmnk.Blazor.Mvvm
Assembly
Dmnk.Blazor.Mvvm.dll

Invokes StateHasChanged when ViewModel fires INotifyPropertyChanged and when any property of type ICommand fires CanExecuteChanged.

public abstract class AbstractMvvmComponentBase<T> : ComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable, IAsyncDisposable where T : INotifyPropertyChanged

Type Parameters

T

The ViewModel

Inheritance
AbstractMvvmComponentBase<T>
Implements
Derived
Inherited Members

Constructors

AbstractMvvmComponentBase()

protected AbstractMvvmComponentBase()

Fields

__CommandBindingsAsync

Allow registering asynchronous command bindings. Useful to integrate with MVVM libraries because regrettably, the standard ICommand does not support async execution, which means that MVVM libraries typically have their own types for async commands. Since we do not want to depend on any specific MVVM library here, this dictionary can be used to cache lambdas created from such async commands.

[Obsolete("Not actually obsolete, but do NOT use this directly in a component.\nBuild some extension methods instead, like in Dmnk.Blazor.Mvvm.CommunityToolkit.")]
public readonly Dictionary<object, Func<Task>> __CommandBindingsAsync

Field Value

Dictionary<object, Func<Task>>

Methods

Dispose()

public virtual void Dispose()

DisposeAsync()

public virtual ValueTask DisposeAsync()

Returns

ValueTask

OnInitialized()

Method invoked when the component is ready to start, having received its initial parameters from its parent in the render tree.

protected override void OnInitialized()