private UITableViewCell CreateLeagueNameCell(UITableView tableView, Foundation.NSIndexPath indexPath, List <int> indexes) { var cell = tableView.DequeueReusableCell("LeagueNameCell", indexPath); cell.BackgroundColor = UIColor.Clear.FromHex(LightGreen.hex); var match = LiveMatches.DistinctBy(m => m.LeagueId).ElementAt(indexes.IndexOf(indexPath.Row)); var league = AppDelegate.SharedAppDelegate.UoW.LeagueRepo.GetLeagueById(match.LeagueId); (cell.ViewWithTag(101) as UIImageView).Image = UIImage.FromBundle(league.Country.ToString().ToLower()); (cell.ViewWithTag(102) as UILabel).Text = league.Name; return(cell); }
public override nint RowsInSection(UITableView tableView, nint section) { if (section == 0) { if (!HasLiveMatch) { return(1); } return(LiveMatches.Count() + LiveMatches.DistinctBy(m => m.LeagueId).Count()); } if (!HasSoonMatch) { return(1); } return(SoonMatches.Count() + SoonMatches.DistinctBy(m => m.LeagueId).Count()); }