public override void UpdateCell(UITableViewCell cell, NSIndexPath indexPath)
{
InputView.TableView = Controller.TableView;
base.UpdateCell(cell, indexPath);
ShowCaption = EditModeValue != EditMode.NoCaption;
cell.TextLabel.Text = string.Empty;
if (ShowCaption)
{
cell.TextLabel.Text = Caption;
}
cell.SelectionStyle = UITableViewCellSelectionStyle.None;
InputView.Text = string.Empty;
IsPassword = false;
var entryAttribute = DataContext.Member.GetCustomAttribute<EntryAttribute>();
if (entryAttribute != null)
{
AutocapitalizationType = entryAttribute.AutocapitalizationType;
AutocorrectionType = entryAttribute.AutocorrectionType;
EditModeValue = entryAttribute.EditMode;
KeyboardType = entryAttribute.KeyboardType;
Placeholder = entryAttribute.Placeholder;
ClearOnEdit = entryAttribute.ClearOnEdit;
}
var passwordAttribute = DataContext.Member.GetCustomAttribute<PasswordAttribute>();
if (passwordAttribute != null)
{
AutocapitalizationType = passwordAttribute.AutocapitalizationType;
AutocorrectionType = passwordAttribute.AutocorrectionType;
EditModeValue = passwordAttribute.EditMode;
KeyboardType = passwordAttribute.KeyboardType;
Placeholder = passwordAttribute.Placeholder;
ClearOnEdit = passwordAttribute.ClearOnEdit;
IsPassword = true;
}
SetKeyboard();
var readOnlyAttribute = DataContext.Member.GetCustomAttribute<ReadOnlyAttribute>();
if (readOnlyAttribute != null)
{
EditModeValue = EditMode.ReadOnly;
}
if (EditModeValue != EditMode.ReadOnly)
{
cell.DetailTextLabel.Text = string.Empty;
// cell.DetailTextLabel.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
// cell.TextLabel.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
}
if (EditModeValue == EditMode.NoCaption)
{
InputView.Placeholder = Caption;
}
else
{
InputView.Placeholder = Placeholder;
}
InputView.AutocapitalizationType = AutocapitalizationType;
InputView.AutocorrectionType = AutocorrectionType;
InputView.Placeholder = Placeholder;
InputView.SecureTextEntry = IsPassword;
InputView.Font = Theme.DetailTextFont;
InputView.KeyboardType = KeyboardType;
InputView.TextAlignment = UITextAlignment.Right;
InputView.ReturnKeyType = ReturnKeyType;
if (Theme.DetailTextColor != null)
{
InputView.TextColor = Theme.DetailTextColor;
}
InputView.InputAccessoryView = new UIKeyboardToolbar(this);
InputView.ReturnKeyType = UIReturnKeyType.Default;
if (DataContext.Value != null)
{
InputView.Text = DataContext.Value.ToString();
}
}