private async void OkButton_Click(object sender, RoutedEventArgs e) { if (mailEntry.Text == string.Empty || !mailEntry.Text.Contains("@")) { setError("Mail"); return; } Classes.Request.Auth.ResetPassword resetPassword = new Classes.Request.Auth.ResetPassword(); resetPassword.SetParam(mailEntry.Text); try { var result = await resetPassword.GetJsonAsync(); Popup p = this.Parent as Popup; HideAnnim.Begin(); p.IsOpen = false; } catch (System.Net.Http.HttpRequestException ex) { setError("Error Network"); Debug.WriteLine(ex); } catch (Newtonsoft.Json.JsonException jEx) { setError("Error Json"); Debug.WriteLine(jEx); } }