コード例 #1
0
 public void UpdateFrom(BaseBooleanImageElement newParent)
 {
     _parent = newParent;
     UpdateImage();
     _label.Text = _parent.Caption;
     SetNeedsDisplay();
 }
コード例 #2
0
            public TextWithImageCellView(BaseBooleanImageElement parent)
                : base(UITableViewCellStyle.Value1, parent.CellKey)
            {
                this._parent = parent;

                _label = new UILabel
                {
                    TextAlignment   = UITextAlignment.Left,
                    Text            = parent.Caption,
                    Font            = Font,
                    BackgroundColor = UIColor.Clear
                };
                _button = UIButton.FromType(UIButtonType.Custom);
                _button.TouchUpInside += delegate
                {
                    parent.Value = !parent.Value;
                    UpdateImage();
                    parent.OnButtonTapped();
                };

                ContentView.Add(_label);
                ContentView.Add(_button);
                UpdateImage();
            }