Пример #1
0
        public async Task LoadMoreData()
        {
            var ids = QueryResult.Result.Skip(Results?.Count ?? 0).Take(10).ToList();

            if (IsFetching || ids.Count == 0)
            {
                return;
            }

            IsFetching = true;
            var getResult = await tradeSearchService.GetResults(QueryResult.Id, ids);

            IsFetching = false;
            if (getResult.Result.Any())
            {
                Results.AddRange(getResult.Result.Select(result => new PriceItem(result)
                {
                    ImageUrl = new Uri(
                        languageProvider.Language.PoeCdnBaseUrl,
                        staticDataService.GetImage(result.Listing.Price.Currency)
                        ).AbsoluteUri,
                }));
            }

            UpdateCountString();
        }
Пример #2
0
        public async Task LoadMoreData()
        {
            if (IsFetching)
            {
                return;
            }

            try
            {
                var ids = QueryResult.Result.Skip(Results?.Count ?? 0).Take(10).ToList();
                if (ids.Count == 0)
                {
                    return;
                }

                IsFetching = true;
                var getResult = await tradeSearchService.GetResults(QueryResult.Id, ids, GetStats());

                IsFetching = false;

                if (getResult != null && getResult.Result.Any())
                {
                    Results.AddRange(getResult.Result.Select(result => new PriceItem(result)
                    {
                        ImageUrl = new Uri(
                            languageProvider.Language.PoeCdnBaseUrl,
                            staticDataService.GetImage(result.Listing.Price.Currency)
                            ).AbsoluteUri,
                    }));
                }

                UpdateCountString();
            }
            catch (Exception e)
            {
                logger.Error(e, "Error loading more data");
            }
        }