void btnUseThisExisting_Click(object sender, RoutedEventArgs e) { try { // prompt to select season Window wdw = GetWindow(this); Cursor = Cursors.Wait; SelectTraktSeasonForm frm = new SelectTraktSeasonForm(); frm.Owner = wdw; frm.Init(AnimeID, AnimeName, EpisodeType.Episode, 1, txtSeriesID.Text.Trim(), 1, 1, AnimeName, Anime, null); bool?result = frm.ShowDialog(); if (result.Value) { SelectedTraktID = txtSeriesID.Text.Trim(); DialogResult = true; Cursor = Cursors.Arrow; Close(); } } catch (Exception ex) { Utils.ShowErrorMessage(ex); } finally { Cursor = Cursors.Arrow; } }
private void CommandBinding_UseThis(object sender, ExecutedRoutedEventArgs e) { Window parentWindow = GetWindow(this); object obj = e.Parameter; if (obj == null) { return; } try { if (obj.GetType() == typeof(CL_TraktTVShowResponse)) { Cursor = Cursors.Wait; CL_TraktTVShowResponse searchResult = obj as CL_TraktTVShowResponse; // prompt to select season Window wdw = GetWindow(this); Cursor = Cursors.Wait; SelectTraktSeasonForm frm = new SelectTraktSeasonForm(); frm.Owner = wdw; frm.Init(AnimeID, AnimeName, EpisodeType.Episode, 1, searchResult.GetTraktID(), 1, 1, AnimeName, Anime, null); bool?result = frm.ShowDialog(); if (result.Value) { SelectedTraktID = searchResult.GetTraktID(); DialogResult = true; Cursor = Cursors.Arrow; Close(); } } } catch (Exception ex) { Utils.ShowErrorMessage(ex); } finally { Cursor = Cursors.Arrow; } }