Class HeadlessVmDialogController
Intended for unit tests: ViewModels are 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
typeMessageBoxType
Returns
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
Show<T>(VmDialogParameters, T)
Show the dialog for a given viewmodel.
Dialog views are resolved via DI through IViewModelRegistry.
Register view-viewmodel pairs using ViewModelRegistration in
your DI setup (e.g. via AddFluentMvvmDialogs()).
public Task<VmDialogReference> Show<T>(VmDialogParameters parameters, T viewModel) where T : IVmDialogViewModel
Parameters
parametersVmDialogParametersviewModelT
Returns
Type Parameters
T