예제 #1
0
        private void UpdateAuthors()
        {
            _authors = AuthorDataProvider.GetAuthors();


            AuthorComboBox.ItemsSource = _authors;
        }
        private void FillOutFields(Book selectedbook)
        {
            BookTitleTextBox.Text          = selectedbook.Title;
            BookIsbnTextBox.Text           = selectedbook.ISBN;
            PublisherTextBox.Text          = selectedbook.Publisher;
            PublishDatePicker.SelectedDate = selectedbook.ReleaseDate;
            GenreTextBox.Text = selectedbook.Genre;
            PagesTextBox.Text = selectedbook.Pages.ToString();
            IList <Author> authors = AuthorDataProvider.GetAuthors();

            AuthorComboBox.ItemsSource = authors;
            var bookauthor = AuthorDataProvider.GetAuthorByBookId(selectedbook.BookId);

            AuthorComboBox.SelectedItem = bookauthor;
            AuthorComboBox.Text         = bookauthor.ToString();
        }