public void ViewRelation(Comunity comunity, int max, RelationIndexType type) { if (comunityDic == null) { CreateComunityDic(); } foreach (var item in comunityDic.Values) { item.NewBrush(Colors.White, 1); } comunity.NewBrush(Colors.Red, 0.8); foreach (var item in comunity.Relations.OrderByDescending(n => n.GetIndex(type)).Take(max)) { if (comunityDic.ContainsKey(item.ItemId)) { comunityDic[item.ItemId].NewBrush(Colors.Orange, 0.5); } } }