public void Add(CheckedPrice check) { if (check.Quality == Quality.Unique) { Uniques.Add(check); } else if (check.Quality == Quality.Unusual) { Unusuals.Add(check); } else { Others.Add(check); } HasResults = true; }
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; }