Exemplo n.º 1
0
 public void UpdateFrom(BaseBooleanImageElement newParent)
 {
     _parent = newParent;
     UpdateImage();
     _label.Text = _parent.Caption;
     SetNeedsDisplay();
 }
Exemplo n.º 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.TouchDown += delegate {
                    parent.Value = !parent.Value;
                    UpdateImage();
                    parent.OnButtonTapped();
                };

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