public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { var cellController = cellFactory.NewTableCellController(tableView, indexPath) as LabelTextInputTableCellController; switch (indexPath.Section) { case 0: if (indexPath.Row == 0) { cellController.BindDataToCell(string.IsNullOrEmpty(loginModel.Url) ? Login.DefaultSmeedeeUrl : loginModel.Url); cellController.BindActionToReturn((textField) => loginModel.Url = textField.Text); cellController.BindOnEditAction(ResetButton); cellController.TextInput.Placeholder = "url"; serverUrl = cellController; } else { cellController.BindDataToCell(string.IsNullOrEmpty(loginModel.Key) ? Login.DefaultSmeedeeKey : loginModel.Key); cellController.BindActionToReturn((textField) => loginModel.Key = textField.Text); cellController.BindOnEditAction(ResetButton); cellController.TextInput.Placeholder = "key"; userKey = cellController; } return(cellController.TableViewCell); default: buttonCell = new UITableViewCell(); buttonCell.TextLabel.TextAlignment = UITextAlignment.Center; ResetButton(); return(buttonCell); } }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { var cellController = cellFactory.NewTableCellController(tableView, indexPath) as LabelTextInputTableCellController; switch (indexPath.Section) { case 0: if (indexPath.Row == 0) { cellController.BindDataToCell(string.IsNullOrEmpty(loginModel.Url) ? Login.DefaultSmeedeeUrl : loginModel.Url); cellController.BindActionToReturn((textField) => loginModel.Url = textField.Text); cellController.BindOnEditAction(ResetButton); cellController.TextInput.Placeholder = "url"; serverUrl = cellController; } else { cellController.BindDataToCell(string.IsNullOrEmpty(loginModel.Key) ? Login.DefaultSmeedeeKey : loginModel.Key); cellController.BindActionToReturn((textField) => loginModel.Key = textField.Text); cellController.BindOnEditAction(ResetButton); cellController.TextInput.Placeholder = "key"; userKey = cellController; } return cellController.TableViewCell; default: buttonCell = new UITableViewCell(); buttonCell.TextLabel.TextAlignment = UITextAlignment.Center; ResetButton(); return buttonCell; } }