Skip to content

Commit

Permalink
Added to DVC and Section to allow each cell in a section to be custom…
Browse files Browse the repository at this point in the history
…ized before it's used. Allows for consistent changes to a section, eg changing the background image
  • Loading branch information
nicwise committed Apr 21, 2013
1 parent a6c714c commit 1489738
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion MonoTouch.Dialog/DialogViewController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ public override UITableViewCell GetCell (UITableView tableView, MonoTouch.Founda
var section = Root.Sections [indexPath.Section];
var element = section.Elements [indexPath.Row];

return element.GetCell (tableView);
return section.CustomizeCell(element.GetCell (tableView), indexPath);
}

public override void WillDisplay (UITableView tableView, UITableViewCell cell, NSIndexPath indexPath)
Expand Down
6 changes: 6 additions & 0 deletions MonoTouch.Dialog/Elements.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2343,6 +2343,12 @@ public override UITableViewCell GetCell (UITableView tv)

return cell;
}

public virtual UITableViewCell CustomizeCell(UITableViewCell source, NSIndexPath indexPath)
{
return source;
}

}

/// <summary>
Expand Down

0 comments on commit 1489738

Please sign in to comment.