// Set up and display the date picker and handle when done picking date
        UIView GetDatePickerView(UITextField dateField)
        {
            var dpSuperView = new UIView(new RectangleF(0, 0, this.View.Frame.Width, 240));

            dpSuperView.BackgroundColor = UIColor.White;


            var dp = new UIDatePicker(new RectangleF(0, 40, 0, 0));

            dp.Mode = UIDatePickerMode.Date;
            dpSuperView.AddSubview(dp);

            var doneButton = new UIButton(new RectangleF((this.View.Frame.Size.Width / 2) - 50, 0, 100, 50));

            doneButton.SetTitle("Done", UIControlState.Normal);
            doneButton.SetTitleColor(this.View.TintColor, UIControlState.Normal);
            dpSuperView.AddSubview(doneButton);

            BNRItem item = BNRItemStore.allItems[dateField.Tag];

            dp.Date = item.dateCreated;

            dp.ValueChanged += (sender2, e2) => {
                DateTime newDate = dp.Date;
                dateField.Text   = newDate.ToLocalTime().ToShortDateString();
                item.dateCreated = newDate.ToLocalTime();
                BNRItemStore.updateDBItem(item);
            };

            doneButton.TouchUpInside += (object sender, EventArgs e) => {
                dateField.EndEditing(true);
            };

            return(dpSuperView);
        }
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            BNRItem item = BNRItemStore.allItems[indexPath.Row];

            HomepwnerItemCell cell = TableView.DequeueReusableCell("HomepwnerItemCell") as HomepwnerItemCell;

            // Configure the cell
            cell.nametextField.Text = item.itemName;

            // Handle text field return key pressed
            cell.nametextField.ShouldReturn += ((textField) => {
                textField.ResignFirstResponder();
                item.itemName = textField.Text;
                BNRItemStore.updateDBItem(item);
                return(true);
            });

            cell.dateField.Text = item.dateCreated.ToShortDateString();
            // Store the index to this item in the button so we can get it in the handler
            cell.dateField.Tag = indexPath.Row;
            if (cell.dateField.InputView == null)
            {
                cell.dateField.InputView = GetDatePickerView(cell.dateField);
            }

            return(cell);
        }