public TextWithImageCellView(BaseBooleanImageElement parent_) : base(UITableViewCellStyle.Value1, parent_.CellKey) { 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(); if (parent.Tapped != null) { parent.Tapped(); } }; ContentView.Add(label); ContentView.Add(button); UpdateImage(); }
public void UpdateFrom(BaseBooleanImageElement newParent) { parent = newParent; UpdateImage(); label.Text = parent.Caption; SetNeedsDisplay(); }
public TextWithImageCellView(BaseBooleanImageElement parent_) : base(UITableViewCellStyle.Value1, parent_.CellKey) { 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(); if (parent.Tapped != null) parent.Tapped(); }; ContentView.Add(label); ContentView.Add(button); UpdateImage(); }
public void UpdateFrom(BaseBooleanImageElement newParent) { parent = newParent; UpdateImage(); label.Text = parent.Caption; SetNeedsDisplay(); }