private void AddRowsToListBox() { List <string> authorNames = _authorTable.AuthorNamesForSelector(_authors); if (authorNames.Count < 1) { string mbMsg = "There are no authors with that name, would you like to add an author?"; MessageBoxResult messageBoxResult = MessageBox.Show(mbMsg, "Add Author Confirmation", MessageBoxButton.YesNo); if (messageBoxResult == MessageBoxResult.Yes) { AddAuthorDlg AddAuthorControl = new AddAuthorDlg(); AddAuthorControl.Show(); } } else { AuthorSelectorLB.Items.Clear(); AuthorSelectorLB.DataContext = authorNames; foreach (string author in authorNames) { AuthorSelectorLB.Items.Add(author); } } }