private void LoginClicked(object sender, RoutedEventArgs e) { try { var email = Email.Text; var password = PasswordBox.Password; var userInfoToPost = new UserInfo { Email = email, Password = password }; var response = ClientConfig <UserInfo> .Post("login", userInfoToPost); if (response.StatusCode == HttpStatusCode.OK) { var userInfo = JsonConvert.DeserializeObject <UserInfo>(response.Content); ToDoLists toDoListsPage = new ToDoLists(userInfo); NavigationService.Navigate(toDoListsPage); } else { MessageBox.Show(response.Content); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void BackClicked(object sender, RoutedEventArgs e) { try { ToDoLists toDoListPage = new ToDoLists(UserInfo); NavigationService.Navigate(toDoListPage); } catch (Exception ex) { MessageBox.Show(ex.Message); } }