private void PhoneTextBox_Validating(object sender, System.ComponentModel.CancelEventArgs e) { if (!PhoneTextBox.MaskCompleted) { ErrorIcon.SetError(PhoneTextBox, "Wrong phone number"); } else if (!authorization.IsPhoneExist(PhoneTextBox.Text)) { ErrorIcon.SetError(PhoneTextBox, "Phone is not exists"); } else { ErrorIcon.Clear(); } }