protected override void Dispose(bool disposing) { if (disposing && InputView != null) { InputView = null; } base.Dispose(disposing); }
public FocusableCellView(RectangleF frame) : base(frame) { InputView = new UIPlaceholderTextField(frame) { BackgroundColor = UIColor.Clear, AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth, Tag = 1, }; CellContentView = InputView; Add(CellContentView); }
public EntryCellView(RectangleF frame) : base(frame) { KeyboardType = UIKeyboardType.Default; EditModeValue = EditMode.WithCaption; InputView = new UIPlaceholderTextField(new RectangleF(5, 0, frame.Width - 10, frame.Height)) { AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight, BackgroundColor = UIColor.Clear, VerticalAlignment = UIControlContentVerticalAlignment.Center, AutocorrectionType = AutocorrectionType, AutocapitalizationType = AutocapitalizationType, Tag = 1 }; InputView.Started += (s, e) => { if (ClearOnEdit) { InputView.Text = string.Empty; } //DataContextProperty.ConvertBack<string>(); }; InputView.ShouldReturn = UITextField => { InputView.ResignFirstResponder(); return(true); }; InputView.EditingDidEnd += (sender, e) => { if (AutocapitalizationType == UITextAutocapitalizationType.AllCharacters) { InputView.Text = InputView.Text.ToUpper(); } DataContext.Value = InputView.Text; InputView.Text = DataContext.Value.ToString(); }; InputView.EditingDidEndOnExit += (sender, e) => { InputView.ResignFirstResponder(); }; Add(InputView); }
public override void InitializeContent() { // _Dummy = new UITextField(Cell.Bounds); // _Dummy.ShouldBeginEditing = tf => // { // ContentView.BecomeFirstResponder(); // return false; // }; ElementView = new UIPlaceholderTextField(Cell.Bounds) { // DataBinding = DataBinding, BackgroundColor = UIColor.Clear, Tag = 1, Hidden = true }; //ContentView = _Dummy; //ContentView.AddSubview(InputControl); }
protected override void Dispose(bool disposing) { if (disposing && _InputControl != null) { _InputControl.Dispose(); _InputControl = null; } base.Dispose(disposing); }
public override void InitializeContent() { if (EditMode != EditMode.ReadOnly) { _InputControl = new UIPlaceholderTextField(new RectangleF(0, 0, Cell.Bounds.Width, Cell.Bounds.Height)) { 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 = Theme.DetailTextFont; _InputControl.KeyboardType = KeyboardType; _InputControl.TextAlignment = Theme.DetailTextAlignment; _InputControl.ReturnKeyType = ReturnKeyType; if (Theme.DetailTextColor != null) _InputControl.TextColor = Theme.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 { DataBinding.UpdateDataContext(); }; ElementView = _InputControl; } }
public EntryCellView(RectangleF frame) : base(frame) { KeyboardType = UIKeyboardType.Default; EditModeValue = EditMode.WithCaption; InputView = new UIPlaceholderTextField(new RectangleF(5, 0, frame.Width - 10, frame.Height)) { AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight, BackgroundColor = UIColor.Clear, VerticalAlignment = UIControlContentVerticalAlignment.Center, AutocorrectionType = AutocorrectionType, AutocapitalizationType = AutocapitalizationType, Tag = 1 }; InputView.Started += (s, e) => { if (ClearOnEdit) { InputView.Text = string.Empty; } //DataContextProperty.ConvertBack<string>(); }; InputView.ShouldReturn = UITextField => { InputView.ResignFirstResponder(); return true; }; InputView.EditingDidEnd += (sender, e) => { DataContext.Value = InputView.Text; InputView.Text = DataContext.Value.ToString(); }; InputView.EditingDidEndOnExit += (sender, e) => { InputView.ResignFirstResponder(); }; Add(InputView); }