public override void Draw (CGRect rect)
{
base.Draw (rect);
var borderColor = this.hasError ? kDefaultErrorColor : kDefaultInactiveColor;
var textRect = this.TextRect (rect);
var context = UIGraphics.GetCurrentContext ();
var borderlines = new CGPoint[] {
new CGPoint (0, textRect.Height - 1),
new CGPoint (textRect.Width, textRect.Height - 1)
};
if (this.Enabled) {
context.BeginPath ();
context.AddLines (borderlines);
context.SetLineWidth (1);
context.SetStrokeColor (borderColor.CGColor);
context.StrokePath ();
}else{
context.BeginPath ();
context.AddLines (borderlines);
context.SetLineWidth (1);
var dashPattern = new nfloat[]{
2,
4
};
context.SetLineDash (0, dashPattern, 2);
context.SetStrokeColor (borderColor.CGColor);
context.StrokePath ();
}
}