migueldeicaza/MonoTouch.Dialog — pull request #172 by Its-Tyson (2013-02-03 02:45:47+00:00)
Title: Section.GetImmediateRootElement() always returns null

The previous implementation of `Element.GetImmediateRootElement()` always assumes the element's parent is a section. This means when the element is actually a section it always returns null. This has flow on effects for methods that rely on it such as `GetContainerTableView()` always returning null for Sections.

I could have made the `Element.GetImmediateRootElement` virtual and overrode it in Section, but that then opens it up for extension in all derived Elements, something I thought was wrong for this method. Instead I do the somewhat weird `section = this as Section`.

No idea what happened with the indent formatting? The files locally are showing the same tab alignment, but now the github 'Files Changed' formatting is showing my additions indented more? Sorry about that.