protected override void OnDraw(Context ctx, Rectangle cellArea) { var pct = GetValue (ValueField); var size = (cellArea.Width * pct) / 100f; cellArea.Width = (int) size; ctx.SetLineWidth (1); ctx.Rectangle (cellArea.Inflate (-0.5, -0.5)); ctx.SetColor (Colors.LightBlue); ctx.FillPreserve (); ctx.SetColor (Colors.Gray); ctx.Stroke (); }
protected override void OnDraw(Context ctx, Rectangle cellArea) { ctx.Rectangle (BackgroundBounds); ctx.SetColor (new Color (0.9, 0.9, 0.9)); ctx.Fill (); ctx.Rectangle (Bounds); ctx.SetColor (new Color (0.7, 0.7, 0.7)); ctx.Fill (); var pct = GetValue (ValueField); var size = (cellArea.Width * pct.Value) / 100f; cellArea.Width = (int) size; ctx.SetLineWidth (1); ctx.Rectangle (cellArea.Inflate (-0.5, -0.5)); ctx.SetColor (Selected ? Colors.Blue : Colors.LightBlue); ctx.FillPreserve (); ctx.SetColor (Colors.Gray); ctx.Stroke (); if (pct.YPos != -1) { ctx.MoveTo (cellArea.Right, Bounds.Y + pct.YPos); ctx.Arc (cellArea.Right, Bounds.Y + pct.YPos, 2.5, 0, 360); ctx.SetColor (Colors.Red); ctx.Fill (); } }