Table of Contents

Class HeadlessVmDialogController

Namespace
Dmnk.Blazor.Dialogs
Assembly
Dmnk.Blazor.Dialogs.dll

Intended for unit tests: ViewModels are registered and opened without an actual view.

public class HeadlessVmDialogController : IVmDialogController
Inheritance
HeadlessVmDialogController
Implements
Inherited Members
Extension Methods

Constructors

HeadlessVmDialogController()

public HeadlessVmDialogController()

Methods

DefaultIconForIntent(MessageBoxType)

Return the default icon for a given message box type. This can be used by the MessageBoxViewModel and other similar dialogs to get the appropriate icon for the type of message box they are showing.

public Icon DefaultIconForIntent(MessageBoxType type)

Parameters

type MessageBoxType

Returns

Icon

GetLastOpenedOfType<T>()

Get the last opened instance of a viewmodel type. This is useful for unit tests to verify that a dialog was opened with the correct viewmodel and parameters.

public T GetLastOpenedOfType<T>()

Returns

T

Type Parameters

T

Register(Type)

Register a viewmodel type. Equivalent of Register(Type, Type).

public void Register(Type viewModelType)

Parameters

viewModelType Type

Register<TViewModel>()

Register a viewmodel type. Equivalent of Register<TComponent, TViewModel>().

public void Register<TViewModel>() where TViewModel : IVmDialogViewModel

Type Parameters

TViewModel

Show<T>(VmDialogParameters, T)

Show the dialog for a given viewmodel.

Before calling this, the component should be registered with its corresponding viewmodel using e.g. Register<TComponent, TViewModel>().

public Task<VmDialogReference> Show<T>(VmDialogParameters parameters, T viewModel) where T : IVmDialogViewModel

Parameters

parameters VmDialogParameters
viewModel T

Returns

Task<VmDialogReference>

Type Parameters

T