public override void InitializeContent() { _Dummy = new UICustomTextField(Bounds); _Dummy.ShouldBeginEditing = tf => { InputControl.BecomeFirstResponder(); return false; }; InputControl = new UICustomTextField(Bounds) { BackgroundColor = UIColor.Clear, Tag = 1, Hidden = true }; ContentView = _Dummy; ContentView.AddSubview(InputControl); }
public override void InitializeContent() { _Dummy = new UICustomTextField(Bounds); _Dummy.ShouldBeginEditing = tf => { InputControl.BecomeFirstResponder(); return(false); }; InputControl = new UICustomTextField(Bounds) { BackgroundColor = UIColor.Clear, Tag = 1, Hidden = true }; ContentView = _Dummy; ContentView.AddSubview(InputControl); }
public override void InitializeContent() { if (EditMode != EditMode.ReadOnly) { Entry = new UICustomTextField() { BackgroundColor = UIColor.Clear, PlaceholderColor = Theme.PlaceholderColor, PlaceholderAlignment = Theme.PlaceholderAlignment, VerticalAlignment = UIControlContentVerticalAlignment.Center, AutocorrectionType = AutoCorrectionType, AutocapitalizationType = AutoCapitalizationType, Tag = 1 }; if (EditMode == EditMode.NoCaption) { Entry.Placeholder = Caption; } else { Entry.Placeholder = Placeholder; } Entry.SecureTextEntry = IsPassword; Entry.Font = DetailTextFont; Entry.KeyboardType = KeyboardType; Entry.TextAlignment = DetailTextAlignment; Entry.ReturnKeyType = ReturnKeyType; if (DetailTextColor != null) { Entry.TextColor = DetailTextColor; } _KeyboardToolbar = new UIKeyboardToolbar(this); Entry.InputAccessoryView = _KeyboardToolbar; Entry.ReturnKeyType = UIReturnKeyType.Default; Entry.Started += (s, e) => { ValueProperty.ConvertBack <string>(); }; Entry.ShouldReturn = delegate { Entry.ResignFirstResponder(); return(true); }; Entry.EditingDidEnd += delegate { ValueProperty.Update(); Entry.SetNeedsDisplay(); }; ContentView = Entry; } else { if (DetailTextLabel != null) { DetailTextLabel.Text = Value; } } }
public override void InitializeContent() { if (EditMode != EditMode.ReadOnly) { InputControl = new UICustomTextField() { BackgroundColor = UIColor.Clear, PlaceholderColor = Theme.PlaceholderColor, PlaceholderAlignment = Theme.PlaceholderAlignment, VerticalAlignment = UIControlContentVerticalAlignment.Center, AutocorrectionType = AutoCorrectionType, AutocapitalizationType = AutoCapitalizationType, Tag = 1 }; if (EditMode == EditMode.NoCaption) InputControl.Placeholder = Caption; else InputControl.Placeholder = Placeholder; InputControl.SecureTextEntry = IsPassword; InputControl.Font = DetailTextFont; InputControl.KeyboardType = KeyboardType; InputControl.TextAlignment = DetailTextAlignment; InputControl.ReturnKeyType = ReturnKeyType; if (DetailTextColor != null) InputControl.TextColor = DetailTextColor; _KeyboardToolbar = new UIKeyboardToolbar(this); InputControl.InputAccessoryView = _KeyboardToolbar; InputControl.ReturnKeyType = UIReturnKeyType.Default; InputControl.Started += (s, e) => { //DataContextProperty.ConvertBack<string>(); }; InputControl.ShouldReturn = delegate { InputControl.ResignFirstResponder(); return true; }; InputControl.EditingDidEnd += delegate { DataContextProperty.Update(); }; ContentView = InputControl; } else { if (DetailTextLabel != null) DetailTextLabel.Text = (string)DataContext; } }