public async Task <List <WebBook> > GetData()
        {
            var books = await _webApi.GetByKeyword("Xamarin", 6, _nextPage);

            if (books.Count() < 6)
            {
                _nextPage = 0;
            }
            else
            {
                _nextPage += 6;
            }

            return(books.ToList());
        }
Exemple #2
0
        public async void WidgetPerformUpdate(Action <NCUpdateResult> completionHandler)
        {
            try
            {
                var books = await _webApi.GetByKeyword("Xamarin", 4, 0);

                _source.Source.Clear();

                foreach (var item in books)
                {
                    _source.Source.Add(item);
                }

                _tableView.ReloadData();


                completionHandler(NCUpdateResult.NewData);
            }
            catch (Exception ex)
            {
                completionHandler(NCUpdateResult.Failed);
            }
        }
Exemple #3
0
 List <WebBook> GetData()
 {
     return(_webApi.GetByKeyword("Xamarin", 4, 0).Result.ToList());
 }
Exemple #4
0
        public async void OnNavigatedTo(INavigationParameters parameters)
        {
            Books = new ObservableCollection <WebBook>(await _webApi.GetByKeyword("Xamarin", 30, 0));

            RaisePropertyChanged(nameof(Books));
        }