示例#1
0
        public async Task LoadFullData(string id = null)
        {
            author = id == null
                ? await _gr.GetAuthorInfo(author.Id)
                : await _gr.GetAuthorInfo(id);

            NotifyPropertyChanged("ImageUrl");
            NotifyPropertyChanged("Name");
            NotifyPropertyChanged("Url");
            NotifyPropertyChanged("Hometown");
            NotifyPropertyChanged("BornAt");
            NotifyPropertyChanged("DiedAt");
            NotifyPropertyChanged("Genre");
            NotifyPropertyChanged("Gender");
            NotifyPropertyChanged("Link");
            NotifyPropertyChanged("CreatedAt");
            NotifyPropertyChanged("About");
            NotifyPropertyChanged("Rating");
            NotifyPropertyChanged("Influences");
            NotifyPropertyChanged("WorksCount");

            var authorBooks = await _gr.GetAuthorBooks(author.Id);
            foreach (var book in authorBooks.Book)
            {
                Books.Add(new BookViewModel(book));
            }
            NotifyPropertyChanged("Books");
        }
示例#2
0
        public AuthorViewModel(Author author)
        {
            this.author = author;

            BookClickCommand = new RelayCommand<ItemClickEventArgs>(UserClick);
        }