public void AddStyle(Product_Style_Model Style, List <Product_Color_Model> lstColor) { ImageStyle item = new ImageStyle(this.Size); item.setLstColor(lstColor.Where(c => c.colorofstyle == Style.Id).ToList()); item.SetStyle(Style); this.Controls.Add(item); CalculateSize(); this.lstColor = lstColor; }
public void SetStyle(List <Product_Style_Model> lstStyle) { foreach (Control item in this.Controls) { item.Dispose(); } foreach (Product_Style_Model item in lstStyle) { this.Controls.Clear(); ImageStyle style = new ImageStyle(this.Size); style.SetStyle(item); this.Controls.Add(style); } CalculateSize(); }