Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 1.14 KB

File metadata and controls

31 lines (22 loc) · 1.14 KB

#Monotouch.Dialog Inline null-able date time picker

An extension to the DateTimeElement from MonoTouch.Dialog to support an inline, expandable/collapsible and nullable UIDateTimePicker.

Very important: You need to set UnevenRows = true in the parent RootElement to work it properly.

Original Monotouch.Dialog datetime picker is not supporting null values. This extension supports null value for UIDateTimeElement as well as:

  • Date picker
  • Date and Time picker
  • Time only

All in one!

Sample code:

RootElement root = new RootElement("Date time demo");
Section section = new Section()
{
                            new InlineDateTimePicker("Date only", DateTime.Today, UIDatePickerMode.Date),              
                            new InlineDateTimePicker("Date and Time", DateTime.Now, UIDatePickerMode.DateAndTime),
                            new InlineDateTimePicker("Time only", DateTime.Now, UIDatePickerMode.Time)
};
            
root.Add(section);

// ****  Important -> This line is very important to open the datetimelement inline.
root.UnevenRows = true;
DialogViewController dialogViewController = new DialogViewController(root);