pglazkov / MvvmValidation

Lightweight library that helps reduce boilerplate when implementing validation in XAML MVVM applications
MIT License
167 stars 31 forks source link

Trigger Single Item Validation? (Looking for help) #27

Closed Dmo16 closed 4 years ago

Dmo16 commented 4 years ago

First off, great little tool, certainly does the job well!

I'd like to trigger validation of a textbox after it loses focus, but only the validation of that textbox, not then entire view model at once.

To use the example project in the solution posted here, instead of validating all fields when a user clicks on "validate" I'd like to be able to validate the "username" field only when it loses focus, then the "email" field only, when it loses focus, and so on.

Any suggestions on how I could accomplish this with 'MvvmValidation'?

Dmo16 commented 4 years ago

Nevermind, I literally did not see this line in your docs:

// Validate a specific target ValidationResult validationResult = Validator.Validate(nameof(FirstName));

Sorry for being blind!