public async void Check_Member_Info() { var file = await ApplicationData.Current.LocalFolder.TryGetItemAsync("token.txt"); if (file != null) { var response = await APIHandle.Get_Member_Infor(); var responseContent = await response.Content.ReadAsStringAsync(); if (response.StatusCode == HttpStatusCode.Created) { await Task.Delay(5000); this.Frame.Navigate(typeof(Views.NavigationView)); } else { Load_Page(); } } else { Load_Page(); } }
public async void Get_Infor() { var file = await ApplicationData.Current.LocalFolder.TryGetItemAsync("token.txt"); if (file != null) { var response = await APIHandle.Get_Member_Infor(); var responseContent = await response.Content.ReadAsStringAsync(); Member member = JsonConvert.DeserializeObject <Member>(responseContent); this.Email.Text = member.email; this.FirstName.Text = member.firstName; this.LastName.Text = member.lastName; this.Phone.Text = member.phone; this.Address.Text = member.address; this.Gender.SelectedValue = member.gender.ToString(); Debug.WriteLine(member.gender); } }