コード例 #1
0
        private async Task InitializeDataAsync()
        {
            var dataServices = new DataServices();

            var eventItems = await dataServices.GetEventsAsync();

            ScheduleAppointmentCollection = new EventItemMapper().MapToScheduleAppointmentCollection(eventItems);

            //ScheduleAppointmentCollection = new ScheduleAppointmentCollection
            //{
            //    new ScheduleAppointment
            //    {²
            //        AllDay = false,
            //        AppointmentBackground = new SolidColorBrush(Colors.Teal),
            //        StartTime = DateTime.Now,
            //        EndTime = DateTime.Now.AddHours(2),
            //        Subject = "Meeting with Mohamed"
            //    },
            //     new ScheduleAppointment
            //    {
            //        AllDay = false,
            //        AppointmentBackground = new SolidColorBrush(Colors.Teal),
            //        StartTime = DateTime.Now.AddHours(3),
            //        EndTime = DateTime.Now.AddHours(1),
            //        Subject = "Meeting with Ali"
            //    },
            //};
        }
コード例 #2
0
        public ScheduleAppointmentCollection MapToScheduleAppointmentCollection(List<EventItem> eventItems)
        {
            if (eventItems == null || eventItems.Count == 0)
            {
                return null;
            }

            var scheduleAppointmentCollection = new ScheduleAppointmentCollection();

            foreach (var eventItem in eventItems)
            {
                scheduleAppointmentCollection.Add(MapTo(eventItem));
            }

            return scheduleAppointmentCollection;
        }