예제 #1
0
        public void DrawDays()
        {
            DateTime today = DateTime.Today;

            row++;

            int day = 1;

            foreach (CalendarItemData data in ((CalendarPageViewModel)BindingContext).ItemList)
            {
                CalendarItem item = new CalendarItem
                {
                    BindingContext = data
                };

                if (CurrentDate.Year == today.Year && CurrentDate.Month == today.Month && day == today.Day)
                {
                    item.SetDate(day.ToString(), -1);
                    CreateAlarm(data.EventList);
                }
                else
                {
                    item.SetDate(day.ToString(), col);
                }

                for (int i = 0; i < data.EventList.Count; i++)
                {
                    item.SetEvent(data.EventList.ElementAt(i));
                }

                calendarGrid.Children.Add(item, col, row);

                col++;
                if (col == 7)
                {
                    col = 0;
                    row++;
                }
                day++;
            }
        }