public override UIView GetViewForHeader(UITableView tableView, int sectionIndex)
{
if (Sections.Count > sectionIndex && Sections.ContainsKey(sectionIndex))
{
var section = Sections[sectionIndex];
if (section != null)
{
if (section.HeaderView == null && !string.IsNullOrEmpty(section.HeaderText))
{
section.HeaderView = CreateHeaderView(tableView, section.HeaderText);
}
return section.HeaderView;
}
}
return null;
}