C# Class MvvmValidation.ValidationScope

Provides a possibility to comibine multiple instances of ValidationHelper into one scope and execute the validation in one go with multiple validators. Useful when validating multiple view models that are not aware of each other and know only about the scope.
Mostra file Open project: pglazkov/MvvmValidation

Public Methods

Method Description
GetResult ( ) : ValidationResult

Gets the result of last validation (without executing the validation).

RegisterValidator ( [ validator ) : void

Registers a validator with this scope.

ValidateAllAsync ( ) : Task

Executes the validation of all registered validators and combines the result from all of them.

Private Methods

Method Description
CombineResults ( IEnumerable results ) : ValidationResult
NotifyCombinedResultChanged ( ) : void
OnResultChanged ( ValidationResultChangedEventArgs e ) : void
OnValidatorResultChanged ( object sender, ValidationResultChangedEventArgs e ) : void

Method Details

GetResult() public method

Gets the result of last validation (without executing the validation).
public GetResult ( ) : ValidationResult
return ValidationResult

RegisterValidator() public method

Registers a validator with this scope.
public RegisterValidator ( [ validator ) : void
validator [ Validator to register.
return void

ValidateAllAsync() public method

Executes the validation of all registered validators and combines the result from all of them.
public ValidateAllAsync ( ) : Task
return Task