TodoApp.iOS.Controls.CalendarMonthView.DrawDayLabels C# (CSharp) Method

DrawDayLabels() private method

Draw day of week labels.
private DrawDayLabels ( CGRect rect ) : void
rect CGRect
return void
        private void DrawDayLabels( CGRect rect )
        {
            // Font size.
            UIFont font = UIFont.BoldSystemFontOfSize(11);
            // Font color.
            UIColor.Gray.SetColor();

            CGContext context = UIGraphics.GetCurrentContext();
            context.SaveState();

            int i = 0;
            foreach (string d in Enum.GetNames(typeof (DayOfWeek))) {
                new NSString(d.Substring(0, 3)).DrawString(
                    new RectangleF(i*BoxWidth + HorizontalPadding, VerticalPadding/2.0f + headerHeight, BoxWidth, 10),
                    font,
                    UILineBreakMode.WordWrap,
                    UITextAlignment.Center);
                i++;
            }
            context.RestoreState();
        }