Beispiel #1
0
        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;
        }
Beispiel #3
0
        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;
        }
Beispiel #4
0
        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;
                }
            }
        }
Beispiel #5
0
 public void Selected(DialogViewController dvc, UITableView tableView, NSIndexPath path)
 {
     Value = !Value;
     ValueProperty.Update();
     UpdateSelected();
 }