public override void UpdateCell() { base.UpdateCell(); //There is a visual artifact when using Checkmark and UITableViewCellSelectionStyle.Blue; Cell.SelectionStyle = UITableViewCellSelectionStyle.None; Value = (bool)ValueProperty.Value; ValueProperty.Update(); UpdateSelected(); }
public override void InitializeContent() { if (Switch == null) { Switch = new UISwitch { BackgroundColor = UIColor.Clear, Tag = 1 }; Switch.AddTarget(delegate { ValueProperty.Update(); }, UIControlEvent.ValueChanged); } Cell.AccessoryView = Switch; }
public override void InitializeContent() { Slider = new UISlider() { BackgroundColor = UIColor.Clear, Continuous = true, Tag = 1 }; Slider.Frame = RectangleF.Empty; Slider.ValueChanged += delegate { ValueProperty.Update(); }; Slider.MaxValue = MaxValue; Slider.MinValue = MinValue; ContentView = Slider; }
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 void Selected(DialogViewController dvc, UITableView tableView, NSIndexPath path) { Value = !Value; ValueProperty.Update(); UpdateSelected(); }