void PrepareCell (UITableViewCell cell)
{
if (cell == null)
return;
cell.Accessory = Accessory;
var tl = cell.TextLabel;
tl.Text = Caption;
tl.TextAlignment = Alignment;
tl.TextColor = TextColor ?? UIColor.Black;
tl.Font = Font ?? UIFont.BoldSystemFontOfSize (17);
tl.LineBreakMode = LineBreakMode;
tl.Lines = Lines;
// The check is needed because the cell might have been recycled.
if (cell.DetailTextLabel != null)
cell.DetailTextLabel.Text = Value == null ? "" : Value;
if (_extraInfo == null){
ClearBackground(cell);
} else {
var imgView = cell.ImageView;
UIImage img;
if (imgView != null)
{
if (_extraInfo.Uri != null)
img = ImageLoader.DefaultRequestImage(_extraInfo.Uri, this);
else if (_extraInfo.Image != null)
img = _extraInfo.Image;
else
img = null;
imgView.Image = img;
}
if (cell.DetailTextLabel != null)
cell.DetailTextLabel.TextColor = _extraInfo.DetailColor ?? UIColor.Gray;
}
if (cell.DetailTextLabel != null){
cell.DetailTextLabel.Lines = Lines;
cell.DetailTextLabel.LineBreakMode = LineBreakMode;
cell.DetailTextLabel.Font = SubtitleFont ?? UIFont.SystemFontOfSize (14);
cell.DetailTextLabel.TextColor = (_extraInfo == null || _extraInfo.DetailColor == null) ? UIColor.Gray : _extraInfo.DetailColor;
}
}