NavigationViewModelBase

Name Value
Assembly Catel.MVVM
Namespace Catel.MVVM
Available on .NET Framework 4.5, .NET Framework 4.6, Xamarin - Android, Xamarin - iOS
public abstract class NavigationViewModelBase : ViewModelBase

Base types ViewModelBase

Extended base class for view models that include navigation. This class adds navigation commands and the navigation service.

Fields

Constructors

Initializes a new instance of the ViewModelBase class. This constructor allows the injection of a custom IServiceLocator.

Parameters

Name Description
serviceLocator The service locator to inject. Ifnull, the Default will be used.
supportIEditableObject if set totrue, the view model will natively support models that implement the interface.
ignoreMultipleModelsWarning if set totrue, the warning when using multiple models is ignored.
skipViewModelAttributesInitialization if set totrue, the initialization will be skipped and must be done manually via InitializeViewModelAttributes.

Exceptions

Name Description
T:Catel.MVVM.ModelNotRegisteredException A mapped model is not registered.
T:Catel.MVVM.PropertyNotFoundInModelException A mapped model property is not found.

Initializes a new instance of the ViewModelBase class.

Parameters

Name Description
supportIEditableObject if set totrue, the view model will natively support models that implement the interface.
ignoreMultipleModelsWarning if set totrue, the warning when using multiple models is ignored.
skipViewModelAttributesInitialization if set totrue, the initialization will be skipped and must be done manually via InitializeViewModelAttributes.

Exceptions

Name Description
T:Catel.MVVM.ModelNotRegisteredException A mapped model is not registered.
T:Catel.MVVM.PropertyNotFoundInModelException A mapped model property is not found.

Properties

Back

Gets the Back command.

Forward

Gets the Forward command.

Gets the navigation service which can be used to navigate inside an application.

Methods

OnBackCanExecute()

Method to check whether the Back command can be executed.

Returns

true if the command can be executed; otherwisefalse

OnForwardCanExecute()

Method to check whether the Forward command can be executed.

Returns

true if the command can be executed; otherwisefalse


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


Discussion