C# Class Catel.MVVM.Views.ViewToViewModelMappingHelper

Helper class to fix ViewToViewModelMapping for IView.
Show file Open project: Catel/Catel

Private Properties

Property Type Description
InitializeViewModel void
OnViewModelChanged void
OnViewModelContainerPropertyChanged void
OnViewModelPropertyChanged void
TransferValue void
UninitializeViewModel void
UninitializeViewToViewModelMappings void

Public Methods

Method Description
InitializeViewToViewModelMappings ( IViewModelContainer viewModelContainer ) : void

Initializes the ViewToViewModelMapping for the specified IViewModelContainer.

UninitializeViewToViewModelMappings ( IViewModelContainer viewModelContainer ) : void

Uninitializes the ViewToViewModelMapping for the specified IViewModelContainer.

ViewToViewModelMappingHelper ( IViewModelContainer viewModelContainer ) : System

Initializes a new instance of the ViewToViewModelMappingHelper class.

Protected Methods

Method Description
TransferValueFromViewModelToView ( IViewModel viewModel, string viewPropertyName, string viewModelPropertyName ) : void

Transfers the value from a view model property to the view property. This method does nothing when viewModel is null.

This method does not check the type of the properties. If the types are incorrect, an exception will be thrown by the .NET Framework.

TransferValueFromViewToViewModel ( IViewModel viewModel, string viewPropertyName, string viewModelPropertyName ) : void

Transfers the value from a view property to the view model property. This method does nothing when viewModel is null.

This method does not check the type of the properties. If the types are incorrect, an exception will be thrown by the .NET Framework.

Private Methods

Method Description
InitializeViewModel ( IViewModel viewModel ) : void

Initializes the specified view model.

OnViewModelChanged ( object sender, EventArgs e ) : void

Called when the view model on the view model container has changed.

OnViewModelContainerPropertyChanged ( object sender, PropertyChangedEventArgs e ) : void

Called when a property on the view model container has changed.

OnViewModelPropertyChanged ( object sender, PropertyChangedEventArgs e ) : void

Called when a property on the view model has changed.

TransferValue ( object source, string sourcePropertyName, object target, string targetPropertyName ) : void

Transfers a value from the source property to the target property.

This method does not check the type of the properties. If the types are incorrect, an exception will be thrown by the .NET Framework.

UninitializeViewModel ( IViewModel viewModel ) : void

Uninitializes the specified view model.

UninitializeViewToViewModelMappings ( ) : void

Uninitializes the ViewToViewModelMapping for the registered IViewModelContainer.

Method Details

InitializeViewToViewModelMappings() public static method

Initializes the ViewToViewModelMapping for the specified IViewModelContainer.
The is null.
public static InitializeViewToViewModelMappings ( IViewModelContainer viewModelContainer ) : void
viewModelContainer IViewModelContainer The view model container to initialize the mappings for.
return void

TransferValueFromViewModelToView() protected method

Transfers the value from a view model property to the view property. This method does nothing when viewModel is null.
This method does not check the type of the properties. If the types are incorrect, an exception will be thrown by the .NET Framework.
The is null or whitespace. The is null or whitespace.
protected TransferValueFromViewModelToView ( IViewModel viewModel, string viewPropertyName, string viewModelPropertyName ) : void
viewModel IViewModel The view model.
viewPropertyName string Name of the view property.
viewModelPropertyName string Name of the view model property.
return void

TransferValueFromViewToViewModel() protected method

Transfers the value from a view property to the view model property. This method does nothing when viewModel is null.
This method does not check the type of the properties. If the types are incorrect, an exception will be thrown by the .NET Framework.
The is null or whitespace. The is null or whitespace.
protected TransferValueFromViewToViewModel ( IViewModel viewModel, string viewPropertyName, string viewModelPropertyName ) : void
viewModel IViewModel The view model.
viewPropertyName string Name of the view property.
viewModelPropertyName string Name of the view model property.
return void

UninitializeViewToViewModelMappings() public static method

Uninitializes the ViewToViewModelMapping for the specified IViewModelContainer.
The is null.
public static UninitializeViewToViewModelMappings ( IViewModelContainer viewModelContainer ) : void
viewModelContainer IViewModelContainer The view model container the uninitialize the mappings for.
return void

ViewToViewModelMappingHelper() public method

Initializes a new instance of the ViewToViewModelMappingHelper class.
The is null.
public ViewToViewModelMappingHelper ( IViewModelContainer viewModelContainer ) : System
viewModelContainer IViewModelContainer The view model container.
return System