private void Window_LoadedAsync(object sender, RoutedEventArgs e) { this.DataContext = BM; //GenreNames g; //var r = Enum.TryParse<GenreNames>("Art", out g); BM.getBooksAsync(); }
private async void BtnSubmit_ClickAsync(object sender, RoutedEventArgs e) { bool isSuccess = false; if (mode_ == Mode.Post) { var msg = await BM_.postBookAsync(); isSuccess = msg.IsSuccessStatusCode; } else if (mode_ == Mode.Put) { var msg = await BM_.putBookAsync(); isSuccess = msg.IsSuccessStatusCode; } if (isSuccess) { mWin_.setStatus("Operation Succeed!"); BM_.getBooksAsync(); } else { mWin_.setStatus("Operation Fail!"); } this.Close(); }