Esempio n. 1
0
        protected virtual UITableViewCell CellFabric(UITableView tableView, Foundation.NSIndexPath indexPath, ISignUpItemBaseViewModel model)
        {
            UITableViewCell cell = null;

            switch (model.Type)
            {
            case RegistrationFieldType.Picker:
                var pickerCell = tableView.DequeueReusableCell(SignUpItemPickerViewCell.Key, indexPath) as SignUpItemPickerViewCell;

                pickerCell.TextField.Placeholder = model.Placeholder;
                cell = pickerCell;
                break;

            case RegistrationFieldType.Date:
                var dateCell = tableView.DequeueReusableCell(SignUpItemDatePickerViewCell.Key, indexPath) as SignUpItemDatePickerViewCell;

                dateCell.TextField.Placeholder = model.Placeholder;
                cell = dateCell;
                break;

            default:
                var baseCell = tableView.DequeueReusableCell(SignUpItemBaseViewCell.Key, indexPath) as SignUpItemBaseViewCell;
                baseCell.TextField.Placeholder = model.Placeholder;

                baseCell.TextField.InputAccessoryView = _accessoryButton;

                baseCell.TextField.ShouldReturn += (textField) =>
                {
                    baseCell.TextField?.ResignFirstResponder();
                    return(true);
                };

                switch (model.RegistrationField.Type)
                {
                case RegistrationFieldType.TextField:
                    baseCell.TextField.KeyboardType = UIKeyboardType.Default;
                    break;

                case RegistrationFieldType.Phone:
                    baseCell.TextField.KeyboardType = UIKeyboardType.NumberPad;
                    break;

                case RegistrationFieldType.Email:
                    baseCell.TextField.KeyboardType = UIKeyboardType.EmailAddress;
                    break;

                case RegistrationFieldType.Password:
                    baseCell.TextField.KeyboardType    = UIKeyboardType.Default;
                    baseCell.TextField.SecureTextEntry = true;
                    baseCell.TextField.SetupSecurity();
                    break;
                }
                cell = baseCell;
                break;
            }

            return(cell);
        }
 /// <summary>
 /// Вызывается при изменении значения любого эл-та (Items[k].Value)
 /// </summary>
 /// <param name="item">Item.</param>
 protected virtual void OnItemValueChanged(ISignUpItemBaseViewModel item)
 {
     PropertiesValid = CheckItems(false);
 }