Esempio n. 1
0
            /// <summary>
            ///     Evaluates the binding state and decides
            ///     which cell template must be constructed.
            /// </summary>
            /// <param name="tableView">The parent <see cref="UITableView"/>.</param>
            /// <param name="fieldBinding">The field binding backing the cell.</param>
            public static DetailFieldCellBase ConstructFieldCell(UITableView tableView, FieldBinding fieldBinding)
            {
                if (DetailFieldCellBase.UseImageCell(fieldBinding))
                {
                    return(ConstructImageCell(tableView, fieldBinding));
                }

                if (DetailFieldCellBase.UseLargeTextCell(fieldBinding))
                {
                    return(fieldBinding.IsValid
                        ? ConstructFieldLargeTextCell(tableView, fieldBinding)
                        : ConstructFieldLargeTextErrorCell(tableView, fieldBinding));
                }

                return(fieldBinding.IsValid
                    ? ConstructFieldPlainCell(tableView, fieldBinding)
                    : ConstructFieldPlainErrorCell(tableView, fieldBinding));
            }
Esempio n. 2
0
        public override float GetHeightForRow(UITableView tableView, NSIndexPath indexPath)
        {
            if (indexPath.Section == 1)
            {
                var commandBinding = GetCommand(indexPath);
                return(DetailCommandCell.GetHeightForRow(commandBinding));
            }

            // If the moveable cell containing the date picker
            // is being used (i.e. visible) we have to make
            // sure we don't confuse it with a field cell.
            if (null != _datePicker && _datePicker.IsDatePickerPath(indexPath))
            {
                return(DetailDatePickerCell.GetHeightForRow());
            }

            var fieldBinding = GetField(indexPath);

            return(DetailFieldCellBase.GetHeightForRow(fieldBinding));
        }