void vk_FriendsGetComplited(Profile[] list) { var l = list.Select(q => new FriendItem(q)).ToList(); var best = l.Take(5).ToArray(); l.AddRange(list.Select(q => q.first_name[0].ToString().ToLower()).Distinct().Select(q => new FriendItem { photo = q.ToString(), first_name = q.ToString() })); friends.ItemsSource = best.Union(l.OrderBy(q => q.first_name)).ToArray(); }
public FriendItem(Profile p) { this.uid = p.uid; this.first_name = p.first_name; this.last_name = p.last_name; this.photo = p.photo; this.online = p.online; this.photo_medium = p.photo_medium; this.photo_medium_rec = p.photo_medium_rec; this.photo_big = p.photo_big; }