protected override UITableViewCell GetCellInternal(UITableView tableView, NSIndexPath indexPath) { tableView.ScrollEnabled = true; PivotProgramListTableViewCell cell = (PivotProgramListTableViewCell)tableView.DequeueReusableCell(PivotProgramListTableViewCell.TableCellKey, indexPath); ProgramViewModel program = null; string FirstElementOfList = Values[0].Name == null ? string.Empty : Values[0].Name.Replace(" ", string.Empty); if (FirstElementOfList.Trim().ToLower() == "manualprogram") { if (indexPath.Row > 0 && indexPath.Row < Values.Count) { program = Values[indexPath.Row]; } } else { if (indexPath.Row < Values.Count) { program = Values[indexPath.Row]; } } //create cell style if (program != null) { if (program.Id != "0") { cell.LoadCellValues(program); } } return(cell); }
public PivotProgramListTableViewCell GetCell(ProgramViewModel program) { PivotProgramListTableViewCell output = null; TableView.ScrollEnabled = true; TableView.LayoutIfNeeded(); for (int n = 0; n < this.Values.Count(); n++) { var cell = this.TableView.CellAt(NSIndexPath.FromRowSection(n, 0)) as PivotProgramListTableViewCell; if (cell != null) { if (Object.ReferenceEquals(cell.Program, program)) { output = cell; break; } } } return(output); }