Catel.MVVM.ViewModelBase.ValidateViewModel C# (CSharp) Method

ValidateViewModel() public method

Validates the specified notify changed properties only.
This method is useful when the view model is initialized before the window, and therefore WPF does not update the errors and warnings.
public ValidateViewModel ( bool force = false, bool notifyChangedPropertiesOnly = true ) : bool
force bool If set to true, a validation is forced (even if the object knows it is already validated).
notifyChangedPropertiesOnly bool if set to true only the properties for which the warnings or errors have been changed /// will be updated via ; otherwise all the properties that /// had warnings or errors but not anymore and properties still containing warnings or errors will be updated.
return bool
        public bool ValidateViewModel(bool force = false, bool notifyChangedPropertiesOnly = true)
        {
            if (IsClosed)
            {
                return true;
            }

            if (SuspendValidation)
            {
                return true;
            }

            Validate(force, notifyChangedPropertiesOnly);

            if (DeferValidationUntilFirstSaveCall)
            {
                return true;
            }

            return !HasErrors;
        }