void ReleaseDesignerOutlets() { if (ConditionLabel != null) { ConditionLabel.Dispose(); ConditionLabel = null; } if (EyeImage != null) { EyeImage.Dispose(); EyeImage = null; } if (LikelihoodLabel != null) { LikelihoodLabel.Dispose(); LikelihoodLabel = null; } if (LikelihoodTextLabel != null) { LikelihoodTextLabel.Dispose(); LikelihoodTextLabel = null; } }
/// <summary> /// Get a cell to be rendered to the UITableView /// NOTE: This method is called: /// - At initialization (for all cells) /// - When a cell is about to be rendered to the screen (for particular cell) /// - When tableView.ReloadData() is called (for all cells) <see cref="RowSelected(UITableView, NSIndexPath)"/> /// </summary> /// <param name="tableView">UITableView associated with this UITableViewSource</param> /// <param name="indexPath">Index of cell</param> /// <returns>The cell to be displayed</returns> public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { // Get cell ConditionViewCell cell; // PrimaryCondition.xib if (indexPath.Row == 0 && tableType == TableType.Primary) { cell = tableView.DequeueReusableCell(ConditionViewCell.PrimaryCellReuseId) as ConditionViewCell; // The primary cell's voice over will always be enabled // as it is always visible EnableCellVoiceOver(cell, true); } else { // Condition.xib cell = tableView.DequeueReusableCell(ConditionViewCell.CellReuseId) as ConditionViewCell; // Enable/disable voice over for secondary cells bool enable = tableType == TableType.Secondary ? !seeMoreVisible : seeMoreVisible; EnableCellVoiceOver(cell, enable); } // Turn off selection styling cell.SelectionStyle = UITableViewCellSelectionStyle.None; // Set Background color cell.HighlightedBgColor = models[indexPath.Row].HighlightColor.ToUIColor(); // Check if the cell is highlighted cell.IsHighlighted = models[indexPath.Row].Selected; // Set Labels of cell to be accessible cell.ConfigureAccessibleLabels(); // Set attributes of cell string condition = Constants.ConditionList[(int)models[indexPath.Row].Condition]; float likelihood = models[indexPath.Row].Score.Likelihood; cell.ConditionName = condition; cell.Likelihood = likelihood; // Set Likelihood label for cell LikelihoodLabel enumlabel = LikelihoodLabelHelper.FromLikelihood(likelihood); cell.LikelihoodText = Constants.LikelihoodLabel[(int)enumlabel]; return(cell); }