0

I have a User Control inside Window which fires validation when a user interacts with that. in code behind of window i check validation result such as :

private void CheckValidationResults(){

if (Validation.GetHasError(MyUserControl.NameTextBox) ||
    Validation.GetHasError(MyUserControl.FamilyTextBox) ||
    Validation.GetHasError(MyUserControl.AgeTextBox)) return;    
else    
 //  do something if every field is valid 

now my question !!

how can i replace it with something like this :

private void CheckValidationResults(){

if (Validation.GetHasError(MyUserControl.Fields)) return;
else
 //  do something if every field is valid 
M.Marquez
  • 23
  • 7

0 Answers0