private void FillViewList(List <GoodsItem> list) { ItemsList.Clear(); var b = from c in list.OrderByDescending(a => a.Value).GroupBy(a => a.Ttype) where c.Count() > 0 select new GroupItem(c.Count(), c.FirstOrDefault().Name, c.FirstOrDefault().Ttype, c.FirstOrDefault().Value); ItemsList.AddRange(b); }