Table of Contents

Class DependencyInjection

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

Extension methods for setting up Blazor MVVM services in an IServiceCollection.

public static class DependencyInjection
Inheritance
DependencyInjection
Inherited Members

Methods

AddBlazorMvvm(IServiceCollection)

Adds core Blazor MVVM services.

public static IServiceCollection AddBlazorMvvm(this IServiceCollection services)

Parameters

services IServiceCollection

Returns

IServiceCollection

AddViewModelRegistrationOpenGeneric(IServiceCollection, Type, Type)

Adds a generic View to ViewModel registration (see CreateOpenGeneric(Type, Type)).

Like AddViewModelRegistration<TViewModel, TView>(IServiceCollection), but for open generic type pairs (e.g. typeof(MyViewModel<>) and typeof(MyView<>)).

In most cases, you would likely want to use the source-generated registrations from the ViewModelForAttribute instead.

public static IServiceCollection AddViewModelRegistrationOpenGeneric(this IServiceCollection services, Type viewModelType, Type viewType)

Parameters

services IServiceCollection
viewModelType Type
viewType Type

Returns

IServiceCollection

AddViewModelRegistration<TViewModel, TView>(IServiceCollection)

Adds a View to ViewModel registration (see ViewModelRegistration).

In most cases, you would likely want to use the source-generated registrations from the ViewModelForAttribute instead.

public static IServiceCollection AddViewModelRegistration<TViewModel, TView>(this IServiceCollection services) where TViewModel : INotifyPropertyChanged where TView : MvvmComponentBase<TViewModel>

Parameters

services IServiceCollection

Returns

IServiceCollection

Type Parameters

TViewModel
TView