void Bindable_Unfocused(object sender, FocusEventArgs e) { string textValue = ((Entry)sender).ValidatedText(); bool isValid = IsRequired ? !string.IsNullOrWhiteSpace(textValue) : true; IsValid = Validators.CnpjValidator(textValue) && isValid; ((Entry)sender).TextColor = IsValid ? DefaultColor : ErrorColor; }
void Bindable_Unfocused(object sender, FocusEventArgs e) { bool IsValid = Validators.CnpjValidator(((Entry)sender).ValidatedText()); ((Entry)sender).TextColor = IsValid ? DefaultColor : Color.Red; }