private async void BtnRegister_OnClick(object sender, RoutedEventArgs e) { Member user = new Member(); user.email = this.txtEmail.Text; user.password = this.txtPassword.Password; user.address = this.txtAddress.Text; user.phone = this.txtPhone.Text; user.dob = this.DoBCalenderPicker.Date.Value.ToString("MM-dd-yyyy"); user.firstName = this.txtFirstName.Text; user.lastName = this.txtLastName.Text; var content = ApiHandle.Register(user); if (content.Result.IsSuccessStatusCode) { txtError.Foreground = new SolidColorBrush(Colors.Green); txtError.Text = "Register Success!!!!"; await Task.Delay(1000); var rootFrame = Window.Current.Content as Frame; rootFrame.Navigate(typeof(MainPage)); } else { txtError.Foreground = new SolidColorBrush(Colors.Red); txtError.Text = "Register Failed!!!!"; } }