Catel.MVVM.Views.ViewToViewModelMappingHelper.TransferValueFromViewToViewModel C# (CSharp) Метод

TransferValueFromViewToViewModel() защищенный Метод

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.
Результат void
        protected void TransferValueFromViewToViewModel(IViewModel viewModel, string viewPropertyName, string viewModelPropertyName)
        {
            Argument.IsNotNullOrWhitespace("viewPropertyName", viewPropertyName);
            Argument.IsNotNullOrWhitespace("viewModelPropertyName", viewModelPropertyName);

            if (viewModel == null)
            {
                Log.Warning("Cannot transfer value from view to view model because view model is null");
                return;
            }

            Log.Debug("Ignore next property changed event for view model.'{0}'", viewModelPropertyName);

            // Ignore this property (we will soon receive an event that it has changed)
            if (!_ignoredViewModelChanges.Contains(viewModelPropertyName))
            {
                _ignoredViewModelChanges.Add(viewModelPropertyName);
            }

            TransferValue(ViewModelContainer, viewPropertyName, viewModel, viewModelPropertyName);

            Log.Debug("No longer ignoring next property changed event for view model.'{0}'", viewModelPropertyName);

            _ignoredViewModelChanges.Remove(viewModelPropertyName);
        }