internal void TriggerInvalidEmailAnimation() { if (LottieEmail.Animation == null) { LottieEmail.Animation = "Unsuccessful.json"; } vM.Error = "Lütfen geçerli bir email adresi giriniz"; AnimateError(nameof(vM.Email), true); LottieEmail.Play(); }
private async void EmailEntry_Unfocused(object sender, FocusEventArgs e) { vM.IsEmailValidationRunning = true; vM.EmailCheckVisible = true; var entry = ((Entry)sender); entry.IsEnabled = false; if (string.IsNullOrWhiteSpace(entry.Text)) { vM.ValidEmail = false; vM.Error = "Mail adresi boş bırakılamaz"; AnimateError(nameof(vM.Email), true); LottieEmail.Animation = "Unsuccessful.json"; } else if (entry.Text.Length > 12) { if (new Regex(@"^(?("")("".+?(?<!\\)""@)|(([0-9a-z]((\.(?!\.))|[-!#\$%&'\*\+/=\?\^`\{\}\|~\w])*)(?<=[0-9a-z])@))" + @"(?(\[)(\[(\d{1,3}\.){3}\d{1,3}\])|(([0-9a-z][-0-9a-z]*[0-9a-z]*\.)+[a-z0-9][\-a-z0-9]{0,22}[a-z0-9]))$", RegexOptions.IgnoreCase).IsMatch(entry.Text)) { var valid = JsonConvert.DeserializeObject <BaseResponseModel>(await Helper.httpGetAsync($"{Utility.BaseURL}/api/user/checkemail?email={entry.Text}")); if (valid.responseVal == 0) { vM.ValidEmail = true; LottieEmail.Animation = "Successful.json"; } else { vM.ValidEmail = false; LottieEmail.Animation = "Unsuccessful.json"; vM.Error = valid.responseText; AnimateError(nameof(vM.Email), true); } } else { vM.ValidEmail = false; LottieEmail.Animation = "Unsuccessful.json"; vM.Error = "Lütfen geçerli bir mail adresi giriniz"; AnimateError(nameof(vM.Email), true); } } else { vM.ValidEmail = false; vM.Error = "Lütfen geçerli bir mail adresi giriniz"; AnimateError(nameof(vM.Email), true); LottieEmail.Animation = "Unsuccessful.json"; } LottieEmail.Play(); entry.IsEnabled = true; vM.EmailCheckVisible = false; vM.IsEmailValidationRunning = false; }