private List <WorkTimeCalendarItem> CreateSchedule() { var schedule = new List <WorkTimeCalendarItem>(); for (int i = 0; i < 7; ++i) { var day = new WorkTimeCalendarItem(); day.WeekDay = (DayOfWeek)i; if (i == 0 || i == 6) { day.IsDayOff = true; schedule.Add(day); continue; } day.StartTime = TimeSpan.FromHours(8); day.EndTime = TimeSpan.FromHours(18); day.BreakStartTime = TimeSpan.FromHours(13); day.BreakEndTime = TimeSpan.FromHours(14); day.HasBreak = day.WeekDay != DayOfWeek.Friday; schedule.Add(day); } return(schedule); }
private void InitCell(ref WorkTimeCalendarCell cell, NSIndexPath indexPath, WorkTimeCalendarItem item) { cell.Init(item); cell.DayTextSize = CalendarModel.DayTextSize; cell.TitleTextSize = CalendarModel.TitleTextSize; cell.DayTextFont = CalendarModel.DayTextFont; cell.TitleFont = CalendarModel.TitleFont; if (item.WeekDay == DateTime.Now.DayOfWeek) { cell.CellBackgroundColor = CalendarModel.CurrentDayBackgroundColor; cell.DayTextColor = CalendarModel.CurrentDayTextColor; cell.TitleColor = CalendarModel.CurrentDayTextColor; cell.DividersColor = CalendarModel.CurrentColorDividers; } else { cell.CellBackgroundColor = indexPath.Row % 2 == 0 ? UIColor.Clear : CalendarModel.DayEvenBackgroundColor; cell.DayTextColor = CalendarModel.DayTextColor; cell.TitleColor = CalendarModel.TitleColor; cell.DividersColor = CalendarModel.ColorDividers; } }