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