Name Value
Assembly Catel.MVVM
Namespace Catel.MVVM
Available on .NET Framework 4.5, .NET Framework 4.6, Xamarin - Android, Xamarin - iOS
public static class IViewModelFactoryExtensions

Extensions for the IViewModelFactory.


CreateViewModel<TViewModel>(IViewModelFactory viewModelFactory, object dataContext, object tag)

Creates a new view model. This is a convenience wrapper around the Object) method. This method cannot be overriden.

Type Parameters

TViewModel The type of the view model.


Name Description
viewModelFactory The view model factory.
dataContext The data context.
tag The preferred tag to use when resolving dependencies.


The newly created IViewModel ornull if no view model could be created.


Name Description
ArgumentNullException The viewModelFactory isnull.
ArgumentException TheTViewModel does not implement the IViewModel interface.

Have a question about Catel? Use StackOverflow with the Catel tag!