/// <summary> /// Command for adding author to the selected author list /// </summary> public void AddAuthorExecute() { ViewAuthor author = SelectedPossibleAuthor; PossibleAuthorsList.Remove(author); SelectedAuthorList.Add(author); }
/// <summary> /// Command for removing author from the selected author list /// </summary> public void RemoveAuthorExecute() { ViewAuthor author = SelectedCurrentAuthor; SelectedAuthorList.Remove(author); PossibleAuthorsList.Add(author); }
/// <summary> /// sets ui values to the selectedcomic /// </summary> /// <param name="comic">comic to set</param> public void SetComic(ViewComic comic) { InputTitle = comic.Title; SelectedViewSeries = comic.Series; InputSeriesNr = comic.SeriesNumber.ToString(); foreach (ViewAuthor author in comic.Authors) { SelectedAuthorList.Add(author); PossibleAuthorsList.Remove(author); } SelectedViewPublisher = comic.Publisher; }
/// <summary> /// Method for filtering out possible authors depending on a given query /// </summary> /// <param name="query"></param> public void FilterOutAuthors(string query) { if (query == "") { PossibleAuthorsList = new ObservableCollection <ViewAuthor>(_allAuthorsList); } else { PossibleAuthorsList.Clear(); foreach (ViewAuthor viewAuthor in _allAuthorsList) { if (viewAuthor.Name.ToLower().StartsWith(query.ToLower())) { PossibleAuthorsList.Add(viewAuthor); } } } }