public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { EpisodeCell ec = tableView.DequeueReusableCell("EpisodeCell", indexPath) as EpisodeCell; var episode = showEntriesViewController.Entries[indexPath.Row]; ec.Configure(episode); return(ec); }
public void Configure(EpisodeCell ec) { var indexPath = this.listView.IndexPathForCell(ec); var episode = Entries[indexPath.Row]; var ts = TimeSpan.FromSeconds(episode.MediaLengthInSeconds.GetValueOrDefault(0)); var duration = ts.Hours > 0 ? $"{ts.Hours}:{ts.Minutes.ToString("00")}:{ts.Seconds.ToString("00")}" : $"{ts.Minutes}:{ts.Seconds}"; ratingLabel.Text = $"Rating: {episode.Rating.ToString("N2")}"; episodeDescriptionLabel.Text = $"Recorded: {episode.PublishedDate.ToShortDateString()}"; // episode.NoHTMLBody; durationLabel.Text = $"Duration: {duration}"; viewCountLabel.Text = $"Views: {episode.Views}"; episodeDetailTextView.Text = episode.CleanBody; }