Ejemplo n.º 1
0
        public void PutEvents(IEnumerable <TableEvent> events)
        {
            foreach (var currentEvent in events)
            {
                int startRow = 0;
                if (currentEvent.From.Date == SelectedDate)
                {
                    startRow = currentEvent.From.Hour;
                }

                int endRow = 23;
                if (currentEvent.To.Date == SelectedDate)
                {
                    endRow = Math.Max(currentEvent.To.Hour, 1);
                }

                var appointmentControl = new CalendarDayOverviewAppointment();
                Grid.SetRow(appointmentControl, startRow);
                Grid.SetRowSpan(appointmentControl, endRow - startRow + 1);
                appointmentControl.DataContext = currentEvent;
                AppointmentGrid.Children.Add(appointmentControl);
            }
        }
        public void PutEvents(IEnumerable<TableEvent> events)
        {
            foreach (var currentEvent in events)
            {
                int startRow = 0;
                if (currentEvent.From.Date == SelectedDate)
                {
                    startRow = currentEvent.From.Hour;
                }

                int endRow = 23;
                if (currentEvent.To.Date == SelectedDate)
                {
                    endRow = Math.Max(currentEvent.To.Hour,1);
                }

                var appointmentControl = new CalendarDayOverviewAppointment();
                Grid.SetRow(appointmentControl,startRow);
                Grid.SetRowSpan(appointmentControl,endRow - startRow + 1);
                appointmentControl.DataContext = currentEvent;
                AppointmentGrid.Children.Add(appointmentControl);

            }
        }