private IBrush GetBrush(IPieData <TKey, TValue> value,
                                IDataPoint <TKey, TValue> current)
        {
            if (!value.ItemColors.TryGetValue(current.Description, out var brush) &&
                !_defaultedColors.TryGetValue(current.Description, out brush))
            {
                var bytes = new Byte[3];
                _random.NextBytes(bytes);
                var color = new Color(bytes[0], bytes[1], bytes[2]);
                brush = new SolidColorBrush(color);
                _defaultedColors[current.Description] = brush;
            }

            return(brush);
        }
Example #2
0
 public ShoppingCartController(IPieData pieData, ShoppingCart shoppingCart)
 {
     _pieData      = pieData;
     _shoppingCart = shoppingCart;
 }
Example #3
0
 public PieController(IPieData pieData, ICategoryData categoryData)
 {
     this._pieData      = pieData;
     this._categoryData = categoryData;
 }
 public HomeController(IConfiguration config, IPieData pieData)
 {
     this._config  = config;
     this._pieData = pieData;
 }