public void IsTodayTest()
        {
            DateTime date = new DateTime(2010, 1, 1);
            SchedulerDayModel day = new SchedulerDayModel(new SchedulerDisplayInfo(new CultureInfo("cs-CZ")), date);
            day.SetDate(date);
            SchedulerMonthDayBodyViewModel target = new SchedulerMonthDayBodyViewModel(day);

            try
            {
                target.PropertyChanged += new PropertyChangedEventHandler(OnPropertyChanged);

                PreparePropertyChangedTest();
                day.SetToday(date.AddDays(-1));
                Assert.IsTrue(NotifiedProperties.Contains("IsToday"), "PropertyChanged event wasn't raised on property 'IsToday' changing to false.");
            }
            finally
            {
                target.PropertyChanged -= new PropertyChangedEventHandler(OnPropertyChanged);
            }
        }
Beispiel #2
0
        private void InitDayCells(List <SchedulerBaseElementViewModel> elementList)
        {
            int row = 1;

            foreach (SchedulerWeekModel week in month.Weeks)
            {
                int col = 1;
                foreach (SchedulerDayModel day in week.Days)
                {
                    SchedulerMonthDayHeaderViewModel header = new SchedulerMonthDayHeaderViewModel(scheduler, day);
                    header.Column = col;
                    header.Row    = row;
                    elementList.Add(header);

                    SchedulerMonthDayBodyViewModel body = new SchedulerMonthDayBodyViewModel(day);
                    body.Column = col;
                    body.Row    = row + 1;
                    elementList.Add(body);

                    col += 1;
                }
                row += 2;
            }
        }
        private void InitDayCells(List<SchedulerBaseElementViewModel> elementList)
        {
            int row = 1;
            foreach (SchedulerWeekModel week in month.Weeks)
            {
                int col = 1;
                foreach (SchedulerDayModel day in week.Days)
                {
                    SchedulerMonthDayHeaderViewModel header = new SchedulerMonthDayHeaderViewModel(scheduler, day);
                    header.Column = col;
                    header.Row = row;
                    elementList.Add(header);

                    SchedulerMonthDayBodyViewModel body = new SchedulerMonthDayBodyViewModel(day);
                    body.Column = col;
                    body.Row = row + 1;
                    elementList.Add(body);

                    col += 1;
                }
                row += 2;
            }
        }