RootElement Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
RootElements are responsible for showing a full configuration page.
public class RootElement : MonoTouch.Dialog.Element, System.Collections.Generic.IEnumerable<MonoTouch.Dialog.Section>
type RootElement = class
inherit Element
interface IEnumerable
interface seq<Section>
- Inheritance
- Derived
- Implements
Remarks
At least one RootElement is required to start the MonoTouch.Dialogs process. RootElements contain in turn a collection of Section objects which in turn contain the various specialized Element instances including other RootElements -- to create nested user interfaces.
RootElements can also be used inside Sections to trigger loading a new nested configuration page. When used in this mode the caption provided is used while rendered inside a section and is also used as the Title for the subpage.
If a RootElement is initialized with a section/element value then this value is used to locate a child Element that will provide a summary of the configuration which is rendered on the right-side of the display.
RootElements are also used to coordinate radio elements. The RadioElement members can span multiple Sections (for example to implement something similar to the ring tone selector and separate custom ring tones from system ringtones).
Sections are added by calling the Add method which supports the C# 4.0 syntax to initialize a RootElement in one pass, for example:
return new RootElement ("Settings") {
new Section ("Basic Settings"){
new BooleanElement ("Airplane Mode", false),
new BooleanElement ("Happy", true),
},
new Section ("Advanced Settings"){
new BooleanElement ("Attend seminars", true)
new BooleanElement ("Enjoy coffee", true)
}
}
Constructors
RootElement(String, Func<RootElement,UIViewController>) | |
RootElement(String, Group) |
Initializes a RootElement that renders the summary based on the radio settings of the contained elements. |
RootElement(String, Int32, Int32) |
Initializes a RootElement with a caption with a summary fetched from the specified section and element |
RootElement(String) |
Initializes a RootSection with a caption |
Fields
Caption |
The caption to display for this given element (Inherited from Element) |
createOnSelected |
Delegate invoked when the RootElement is tapped. |
NeedColorUpdate |
Set to direct the DialogViewController to call the WillDisplay method on cells that implement IColorizeBackground. |
Parent |
Handle to the container object. (Inherited from Element) |
TableView |
The UITableView that is rendering the current RootElement. |
UnevenRows |
Reports whether the rows have all the same size or not. |
Properties
CellKey |
Subclasses that override the GetCell method should override this method as well (Inherited from Element) |
Count |
Number of sections in this RootElement. |
IndexPath |
Returns the IndexPath of a given element. This is only valid for leaf elements, it does not work for a toplevel RootElement or a Section of if the Element has not been attached yet. (Inherited from Element) |
Item[Int32] |
Returns the section at the specified index. |
RadioSelected |
The currently selected Radio item in the whole Root. |
Methods
Add(IEnumerable<Section>) |
Adds all of the sections in the IEnumerable to this root element. |
Add(Section) |
Adds a new section to this RootElement |
Clear() |
Removes all the sections from this RootElement. |
Deselected(DialogViewController, UITableView, NSIndexPath) | (Inherited from Element) |
Dispose() | (Inherited from Element) |
Dispose(Boolean) |
Releases the resources held by this RootElement and its children. |
GetActiveCell() | (Inherited from Element) |
GetCell(UITableView) | |
GetContainerTableView() | (Inherited from Element) |
GetImmediateRootElement() |
If the cell is attached will return the immediate RootElement (Inherited from Element) |
Insert(Int32, Section) |
Inserts a new section into the RootElement |
Insert(Int32, UITableViewRowAnimation, Section[]) | |
MakeViewController() | |
Matches(String) |
Method invoked to determine if the cell matches the given text, never invoked with a null value or an empty string. (Inherited from Element) |
Prepare() | |
PrepareDialogViewController(UIViewController) | |
Reload(Element, UITableViewRowAnimation) | |
Reload(Section, UITableViewRowAnimation) | |
Remove(Section, UITableViewRowAnimation) | |
Remove(Section) |
Removes the specified section from this RootElement using the default animation. |
RemoveAt(Int32, UITableViewRowAnimation) | |
RemoveAt(Int32) |
Removes a section at a specified location using the default animation. |
Selected(DialogViewController, UITableView, NSIndexPath) | |
Summary() |
Returns a summary of the value represented by this object, suitable for rendering as the result of a RootElement with child objects. (Inherited from Element) |
Explicit Interface Implementations
IEnumerable.GetEnumerator() |
Enumerator that returns all the sections in the RootElement. |
IEnumerable<Section>.GetEnumerator() |
Enumerator that returns all the sections in this RootElement. |