RootElement RootElement Class

Definition

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
RootElementRootElement
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) RootElement(String)

Initializes a RootSection with a caption

RootElement(String, Func<RootElement,UIViewController>) RootElement(String, Func<RootElement,UIViewController>)
RootElement(String, Group) RootElement(String, Group)

Initializes a RootElement that renders the summary based on the radio settings of the contained elements.

RootElement(String, Int32, Int32) RootElement(String, Int32, Int32)

Initializes a RootElement with a caption with a summary fetched from the specified section and element

Fields

Caption Caption

The caption to display for this given element

(Inherited from Element)
createOnSelected createOnSelected

Delegate invoked when the RootElement is tapped.

NeedColorUpdate NeedColorUpdate

Set to direct the DialogViewController to call the WillDisplay method on cells that implement IColorizeBackground.

Parent Parent

Handle to the container object.

(Inherited from Element)
TableView TableView

The UITableView that is rendering the current RootElement.

UnevenRows UnevenRows

Reports whether the rows have all the same size or not.

Properties

CellKey CellKey

Subclasses that override the GetCell method should override this method as well

(Inherited from Element)
Count Count

Number of sections in this RootElement.

IndexPath 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] Item[Int32]

Returns the section at the specified index.

RadioSelected RadioSelected

The currently selected Radio item in the whole Root.

Methods

Add(IEnumerable<Section>) Add(IEnumerable<Section>)

Adds all of the sections in the IEnumerable to this root element.

Add(Section) Add(Section)

Adds a new section to this RootElement

Clear() Clear()

Removes all the sections from this RootElement.

Deselected(DialogViewController, UITableView, NSIndexPath) Deselected(DialogViewController, UITableView, NSIndexPath) Inherited from Element
Dispose() Dispose() Inherited from Element
Dispose(Boolean) Dispose(Boolean)

Releases the resources held by this RootElement and its children.

GetActiveCell() GetActiveCell() Inherited from Element
GetCell(UITableView) GetCell(UITableView)
GetContainerTableView() GetContainerTableView() Inherited from Element
GetImmediateRootElement() GetImmediateRootElement()

If the cell is attached will return the immediate RootElement

(Inherited from Element)
Insert(Int32, Section) Insert(Int32, Section)

Inserts a new section into the RootElement

Insert(Int32, UITableViewRowAnimation, Section[]) Insert(Int32, UITableViewRowAnimation, Section[])
MakeViewController() MakeViewController()
Matches(String) 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() Prepare()
PrepareDialogViewController(UIViewController) PrepareDialogViewController(UIViewController)
Reload(Element, UITableViewRowAnimation) Reload(Element, UITableViewRowAnimation)
Reload(Section, UITableViewRowAnimation) Reload(Section, UITableViewRowAnimation)
Remove(Section) Remove(Section)

Removes the specified section from this RootElement using the default animation.

Remove(Section, UITableViewRowAnimation) Remove(Section, UITableViewRowAnimation)
RemoveAt(Int32) RemoveAt(Int32)

Removes a section at a specified location using the default animation.

RemoveAt(Int32, UITableViewRowAnimation) RemoveAt(Int32, UITableViewRowAnimation)
Selected(DialogViewController, UITableView, NSIndexPath) Selected(DialogViewController, UITableView, NSIndexPath)
Summary() 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() IEnumerable.GetEnumerator()

Enumerator that returns all the sections in the RootElement.

IEnumerable<Section>.GetEnumerator() IEnumerable<Section>.GetEnumerator()

Enumerator that returns all the sections in this RootElement.

Applies to