public override int RowsInSection(UITableView tableview, int sectionIndex)
{
if (IsRootCell || IsCollapsed)
{
return 1;
}
var numberOfRows = IsCollapsed ? 0 : 0;
if (Sections.ContainsKey(sectionIndex))
{
numberOfRows += Sections[sectionIndex].DataContext.Count;
}
return Sections != null ? numberOfRows : 0;
}