This class is used to render a string + a state in the form of an image.
It is abstract to avoid making this element keep two pointers for the state images, saving 8 bytes per slot. The more derived class "BooleanImageElement" shows one way to implement this by keeping two pointers, a better implementation would return pointers to images that were preloaded and are static. A subclass only needs to implement the GetImage method.
Inheritance: BoolElement
 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();
			}