Esempio n. 1
0
        public async Task LoadFullData(string bookid = null)
        {
            book = bookid == null ? await _gr.GetBookInfo(Id) : await _gr.GetBookInfo(bookid);

            NotifyPropertyChanged("BookImageURL");
            NotifyPropertyChanged("OriginalTitle");
            NotifyPropertyChanged("BookTitle");
            NotifyPropertyChanged("RatingsCount");
            NotifyPropertyChanged("TextReviewsCount");
            NotifyPropertyChanged("Publisher");
            NotifyPropertyChanged("OriginalPublishDate");
            NotifyPropertyChanged("OriginalPublishDateString");
            NotifyPropertyChanged("PublishDateString");
            NotifyPropertyChanged("PublishDate");
            NotifyPropertyChanged("NumberOfPages");
            NotifyPropertyChanged("Url");
            NotifyPropertyChanged("Language");
            NotifyPropertyChanged("Rating");
            NotifyPropertyChanged("Description");
            NotifyPropertyChanged("NotInShelf");

            BuildBookDetailsList();
            NotifyPropertyChanged("Details");

            Reviews = new ObservableCollection<ReviewViewModel>();
            foreach (var review in book.Reviews.Review)
            {
                Reviews.Add(new ReviewViewModel(review));
            }
            NotifyPropertyChanged("Reviews");
        }
Esempio n. 2
0
        public BookViewModel(Book book)
        {
            this.book = book;

            AuthorClickCommand = new RelayCommand<RoutedEventArgs>(AuthorClick);
            WantToReadCommand = new RelayCommand(WantToReadClick);
            BookClickCommand = new RelayCommand(BookClick);
        }