public void RunFilter()
        {
            if (!_loaded)
            {
                return;
            }

            if (!ValidMin || !ValidMax)
            {
                return;
            }

            const int MAX_SHOWN = 500;

            List<ItemPricing> cmdRes = CmdRange.GetInRange(Range, Filters);

            List<ItemPricing> buf = new List<ItemPricing>();
            for (int i = 0; i < MAX_SHOWN && i < cmdRes.Count; i++)
            {
                buf.Add(cmdRes[i]);
            }
            buf.Sort((a, b) => a.Pricing.Low.TotalRefined.CompareTo(b.Pricing.Low.TotalRefined));

            Pricings.Clear();
            foreach (ItemPricing p in buf)
            {
                ItemPriceInfo info = new ItemPriceInfo(p.Item, p.Quality);

                if (info.Quality == Quality.Unusual && p.PriceIndex > 0)
                {
                    info.Unusual = DataManager.Schema.GetUnusual(p.PriceIndex);
                }

                PricedViewModel vm = new PricedViewModel(info, p.Pricing);

                Pricings.Add(vm);
            }

            if (cmdRes.Count > MAX_SHOWN)
            {
                PricingsCountTxt.Text = Pricings.Count + " pricings shown (" +
                    cmdRes.Count + " results found)";
            }
            else
            {
                PricingsCountTxt.Text = Pricings.Count + " pricings found matching filters";
            }
        }
		public void RefreshPriceLabels()
		{
			if (Info == null)
			{
				EvaluatedPrice = null;
				return;
			}

			var flagged = PriceChecker.GetPriceFlagged(Info);
			IsMarket = flagged.Contains("market");
			EvaluatedPrice = flagged.Result;

			// Bindings aren't working for some reason...
			PriceLabelText.Text = IsMarket ? "Price (Market):" : "Price:";
			PriceActualText.Text = EvaluatedPriceString;
			PriceUSDText.Text = EvaluatedPriceUSD;

			if (CalcList.SelectedIndex != -1 && IsCalcEditing)
			{
				int index = CalcList.SelectedIndex;
				CalculatorContents[index] = new PricedViewModel(Info, EvaluatedPrice ?? PriceRange.Zero);
				CalcList.SelectedIndex = index;
				RefreshCalcLabels();
			}
		}
        public Grid GetPriceStamp(CheckedPrice cp)
        {
            Grid res = new Grid();
            ItemPriceInfo info = new ItemPriceInfo(cp.Pricing?.Item, cp.Quality);
            PricedViewModel pvm = new PricedViewModel(info, cp.Price);
            res.ToolTip = pvm.Tooltip;
            res.Margin = new Thickness(2);

            string priceText = cp.Price.ToString();
            bool craftable = cp.Craftable;
            Quality actualQuality = cp.Quality;

            TextBlock textBlock = new TextBlock();
            textBlock.Text = priceText;
            textBlock.FontWeight = FontWeights.SemiBold;
            textBlock.Foreground = new SolidColorBrush(Colors.White);
            textBlock.HorizontalAlignment = HorizontalAlignment.Center;
            textBlock.VerticalAlignment = VerticalAlignment.Center;
            textBlock.Margin = new Thickness(3);
            textBlock.FontSize = 10;

            Rectangle rect = new Rectangle();
            rect.StrokeThickness = 2;
            rect.Fill = new SolidColorBrush(actualQuality.ToWPFColor());
            rect.Stroke = new SolidColorBrush(actualQuality.ToWPFBorderColor());
            if (!craftable)
            {
                rect.StrokeDashArray = new DoubleCollection(new double[] { 0, 2, 0 });
            }

            res.Children.Add(rect);
            res.Children.Add(textBlock);

            return res;
        }