public PeriodicCell(RectangleF frame, Element element) : base(frame) { this.Element = element; this.BackgroundColor = CellBackgroundColor; lblAtomicNumber = new PTLabel() { Text = this.Element.AtomicNumber.ToString(), TextColor = UIColor.White, BackgroundColor = UIColor.Clear }; lblSymbol = new PTLabel() { Text = this.Element.Symbol, TextColor = UIColor.White, TextAlignment = UITextAlignment.Center, BackgroundColor = this.BackgroundColor }; lblName = new PTLabel() { Text = this.Element.Name, TextColor = UIColor.White, TextAlignment = UITextAlignment.Center, AdjustsFontSizeToFitWidth = true, BackgroundColor = UIColor.Clear //BackgroundColor = UIColor.Red }; // lblWeight = new PTLabel() // { // Text = this.Element.AtomicWeight, // AdjustsFontSizeToFitWidth = true // }; Add(lblSymbol); Add(lblAtomicNumber); Add(lblName); // Add(lblWeight); this.TouchDragEnter += (object sender, EventArgs e) => { HighlightCell(); }; this.TouchDown += (object sender, EventArgs e) => { HighlightCell(); }; this.TouchDragExit += (object sender, EventArgs e) => { UnhighlightCell(); }; this.TouchUpInside += (object sender, EventArgs e) => { UnhighlightCell(); }; }