public void AddBroadcastHistory(BroadcastInfo info) { if (FindBroadcastHistroryItem(info) != null) { return; } var fav = BroadcastHistory.Where(i => i.Favorite); var others = BroadcastHistory.Where(i => !i.Favorite); BroadcastHistory = fav.Concat(Enumerable.Repeat(info, 1).Concat(others.Take(19))).ToArray(); }
public void AddBroadcastHistory(BroadcastInfoViewModel info) { if (BroadcastHistory.Any(i => i.Equals(info))) { return; } var fav = BroadcastHistory.Where(i => i.Favorite); var others = BroadcastHistory.Where(i => !i.Favorite); BroadcastHistory = new ObservableCollection <BroadcastInfoViewModel>( fav.Concat(Enumerable.Repeat(info, 1)) .Concat(others.Take(19)) ); }