public async void GetPriceStats()
        {
            if (Item.UniqueName == null)
            {
                return;
            }

            var statPricesList = await ApiController.GetCityItemPricesFromJsonAsync(Item.UniqueName,
                                                                                    Locations.GetLocationsListByArea(new IsLocationAreaActive(ShowBlackZoneOutpostsChecked, ShowVillagesChecked, true)),
                                                                                    GetQualities());

            if (statPricesList == null)
            {
                return;
            }

            var statsPricesTotalList = PriceUpdate(statPricesList);

            FindBestPrice(ref statsPricesTotalList);

            var marketCurrentPricesItemList = statsPricesTotalList.Select(item => new MarketCurrentPricesItem(item)).ToList();

            if (LoadingImageVisibility != Visibility.Hidden)
            {
                LoadingImageVisibility = Visibility.Hidden;
            }

            MarketCurrentPricesItemList = marketCurrentPricesItemList;
            SetDifferenceCalculationText(statsPricesTotalList);

            HasItemPrices          = true;
            RefreshIconTooltipText = $"{LanguageController.Translation("LAST_UPDATE")}: {Formatting.CurrentDateTimeFormat(DateTime.Now)}";
        }
        public void GetMainPriceStats()
        {
            if (_currentCityPrices == null)
            {
                return;
            }

            var statsPricesTotalList = PriceUpdate(_currentCityPrices);

            FindBestPrice(ref statsPricesTotalList);

            var marketCurrentPricesItemList = statsPricesTotalList.Select(item => new MarketCurrentPricesItem(item)).ToList();

            if (LoadingImageVisibility != Visibility.Hidden)
            {
                LoadingImageVisibility = Visibility.Hidden;
            }

            MarketCurrentPricesItemList = marketCurrentPricesItemList;
            SetDifferenceCalculationText(statsPricesTotalList);

            HasItemPrices          = true;
            RefreshIconTooltipText = $"{LanguageController.Translation("LAST_UPDATE")}: {Formatting.CurrentDateTimeFormat(DateTime.Now)}";
        }
示例#3
0
        public void GetMainPriceStats()
        {
            if (CurrentCityPrices == null)
            {
                return;
            }

            var filteredCityPrices   = GetFilteredCityPrices(ShowBlackZoneOutpostsChecked, ShowVillagesChecked, true, true);
            var statsPricesTotalList = PriceUpdate(filteredCityPrices);

            FindBestPrice(ref statsPricesTotalList);

            var marketCurrentPricesItemList = statsPricesTotalList.Select(item => new MarketCurrentPricesItem(item)).ToList();

            if (LoadingImageVisibility != Visibility.Hidden)
            {
                LoadingImageVisibility = Visibility.Hidden;
            }

            MarketCurrentPricesItemList = marketCurrentPricesItemList;
            SetAveragePricesString();

            HasItemPrices          = true;
            RefreshIconTooltipText = $"{LanguageController.Translation("LAST_UPDATE")}: {Formatting.CurrentDateTimeFormat(DateTime.Now)}";
        }