MonoTouch.Dialog Namespace

Simplified creation of user interfaces.

Classes

ActivityElement

An element that can be used to show an activity indicator.

AlignmentAttribute

Apply this attribute to properties and fields to instruct the BindingContext how it should align the text on the row.

BadgeElement

This element can be used to show an image with some text

BaseBooleanImageElement

This class is used to render a string + a state in the form of an image.

BaseBooleanImageElement.TextWithImageCellView

Custom UITableViewCell to display text with an image (used by the BaseBooleanImageElement).

BindingContext

Helper class used to map Structures and Classes into user interface elements in MonoTouch.Dialog.

BooleanElement

Used to display switch on the screen.

BooleanImageElement

This class is used to render a string + a state in the form of an image.

BoolElement

Base class for BoolElement and BaseBooleanImageElement

CaptionAttribute

On Reflection-based UIs, this attribute can be applied to a member to set the caption for the element.

CheckboxAttribute

On Reflection-based UIs, this attribute can be applied to boolean values to use a checkbox to render the boolean value.

CheckboxElement

An element that can be used as a checkbox

DateAttribute

Attribute applied to DateTime objects to instruct the rendering to be done using the Date selector.

DateElement

An element that can be used to edit dates.

DateTimeElement

An element that can be used to edit dates and times.

DialogViewController

The DialogViewController is the main entry point to use MonoTouch.Dialog, it provides a simplified API to the UITableViewController.

DialogViewController.SizingSource

Default UITableViewSource used by MonoTouch.Dialog when the elements contained are expected to have different heights.

DialogViewController.Source

Default UITableViewSource used by MonoTouch.Dialog when all of the elements contained have a constant height.

Element

Base class for all elements in MonoTouch.Dialog

EntryAttribute

Apply this attribute to strings to produce an editing row.

EntryElement

An element that can be used to enter text.

FloatElement

Used to display a slider on the screen.

GlassButton

GlassButton is a glossy/glass button. User code can use either targets or can subscribe to the Tapped event. Colors are customized by assigning to the NormalColor, HighlightedColor and DisabledColor properties

GraphicsUtil

Graphics utilities used by MonoTouch.Dialog elements

Group

Used by root elements to fetch information when they need to render a summary (Checkbox count or selected radio group).

HtmlAttribute
HtmlElement

Used to display a cell that will launch a web browser when selected.

ImageElement

Element to pick images from the local photo library.

ImageStringElement

An element that displays an thumbnail image with a string, not stylable.

JsonElement

RootElement that is instantiated from a Json source.

LoadMoreElement

An element that amimates when tapped indicating that more data is being loaded.

MessageElement

Element to display a mail message-like record with sender, subject, date, read/unread statuses.

MessageSummaryView
MultilineAttribute
MultilineElement
OnTapAttribute
OwnerDrawnElement
PasswordAttribute
RadioElement
RadioGroup

Captures the information about mutually exclusive elements in a RootElement

RadioSelectionAttribute
RangeAttribute
RefreshTableHeaderView
RootElement

RootElements are responsible for showing a full configuration page.

SearchChangedEventArgs
Section

Sections contain individual Element instances that are rendered by MonoTouch.Dialog

SectionAttribute

On Reflection-based UIs, this attribute can be applied to a member to start a new section.

SkipAttribute

Apply this attribute to a Property or Field to have the BindingContext ignore this object when generating the UI

StringElement

The string element can be used to render some text in a cell that can optionally respond to tap events.

StyledMultilineElement
StyledStringElement

A version of the StringElement that can be styled with a number of formatting options and can render images or background images either from UIImage parameters or by downloading them from the net.

TimeAttribute

Attribute applied to DateTime objects to instruct the rendering to be done using the Time selector.

TimeElement

An element that can be used to edit times

UIViewElement

This element can be used to insert an arbitrary UIView

Interfaces

IColorizeBackground

This interface is implemented by Elements that needs to update their cells Background properties just before they are displayed to the user. This is an iOS 3 requirement to properly render a cell.

IElementSizing

This interface is implemented by Element classes that will have different heights

Enums

RefreshViewStatus
UIViewElement.CellFlags

Delegates

DialogViewController.SearchTextEventHandler

Remarks

MonoTouch.Dialog is a foundation to create dialog boxes and show table-based information without having to write dozens of delegates and controllers for the user interface. MonoTouch.Dialog is a retained system for implementing UITableViews as opposed to the on-demand nature of UITableView.

The infrastructure provides many conveniences that allow developers to create dashing UITableView-based user interfaces with a fraction of the effort. It features a big collection of custom cell renderers and features like pull-to-refresh and built-in search.

This code snippet generates the following UI:


return new RootElement ("Settings") {
    new Section (){
        new BooleanElement ("Airplane Mode", false),
        new RootElement ("Notifications", 0, 0) {
            new Section (null, 
                 "Turn off Notifications to disable Sounds\n" +
                     "Alerts and Home Screen Badges for the\napplications below."){
                new BooleanElement ("Notifications", false)
            }
        }},
    new Section (){
    new RootElement ("Sounds"){
            new Section ("Silent") {
                new BooleanElement ("Vibrate", true),
            },
            new Section ("Ring") {
                new BooleanElement ("Vibrate", true),
                new FloatElement (null, null, 0.8f),
                new RootElement ("Ringtone", new RadioGroup (0)){
                    new Section ("Custom"){
                        new RadioElement ("Circus Music"),
                        new RadioElement ("True Blood"),
                    },
                    new Section ("Standard"){
            from name in "Marimba,Alarm,Ascending,Bark".Split (',')
            (Element) new RadioElement (n)
                    }
                },
                new RootElement ("New Text Message", new RadioGroup (3)){
                    new Section (){
            from name in "None,Tri-tone,Chime,Glass,Horn,Bell,Electronic".Split (',')
            (Element) new RadioElement (n)
                    }
                },
                new BooleanElement ("New Voice Mail", false),
                new BooleanElement ("New Mail", false),
                new BooleanElement ("Sent Mail", true),
            }
        },
        new RootElement ("Brightness"){
            new Section (){
                new FloatElement (null, null, 0.5f),
                new BooleanElement ("Auto-brightness", false),
            }
        },
        new RootElement ("Wallpaper"){ MakeWallPaper (); }
    },
    new Section () {
        new EntryElement ("Login", "Your login name", "miguel"),
        new EntryElement ("Password", "Your password", "password", true),
        new DateElement ("Select Date", DateTime.Now),
    },
}

MonoTouch.Dialog core entry point is a UIViewController called the DialogViewController. You initialize instances of this object from an object of type RootElement or JsonElement.

We have included a version of MonoTouch.Dialog with MonoTouch, but we have renamed the assembly to MonoTouch.Dialog-1.dll to prevent any problems with users that might have a modified copy of MonoTouch.Dialog or have an existing working setup from being altered.

To use MonoTouch.Dialog with your project, merely add a reference to MonoTouch.Dialog-1.dll from the Edit Reference menu item in your project.

If you want to use your own copy of MonoTouch.Dialog, you can still use the publicly available MonoTouch.Dialog or your own forked version of it.