internal void TriggerInvalidUsernameAnimation() { if (LottieUser.Animation == null) { LottieUser.Animation = "Unsuccessful.json"; } vM.Error = "Lütfen geçerli bir kullanıcı adı giriniz"; AnimateError(nameof(vM.Username), true); LottieUser.Play(); }
private async void UsernameEntry_Unfocused(object sender, FocusEventArgs e) { vM.IsUsernameValidationRunning = true; vM.UsernameCheckVisible = true; var entry = (Entry)sender; entry.IsEnabled = false; if (string.IsNullOrWhiteSpace(entry.Text)) { vM.ValidUsername = false; vM.Error = "Kullanıcı adı boş bırakılamaz"; AnimateError(nameof(vM.Username), true); LottieUser.Animation = "Unsuccessful.json"; } else if (entry.Text.Length > 4 && entry.Text.Length < 12) { var serviceResponse = JsonConvert.DeserializeObject <BaseResponseModel>(await Helper.httpGetAsync($"{Utility.BaseURL}/api/user/checkusername?username={entry.Text}")); if (serviceResponse.responseVal == 0) { vM.ValidUsername = true; LottieUser.Animation = "Successful.json"; } else { vM.ValidUsername = false; vM.Error = serviceResponse.responseText; AnimateError(nameof(vM.Username), true); LottieUser.Animation = "Unsuccessful.json"; } } else { vM.ValidUsername = false; vM.Error = "Kullanıcı adınız 4 karakterden kısa 12 karakterden uzun olamaz"; AnimateError(nameof(vM.Username), true); LottieUser.Animation = "Unsuccessful.json"; } LottieUser.Play(); entry.IsEnabled = true; vM.UsernameCheckVisible = false; vM.IsUsernameValidationRunning = false; }