public IEnumerable<IResult> SchedulerClosedDaysVisibleRangeChanged(object sender, EventArgs e)
        {
            // Provides the New Range for the Scheduler
            this.SchedulerIsBusy = true;
            var range = (sender as RadScheduleView).VisibleRange;

            var req = new LoadBusinessClosedDaysRequest(DateEx.GetStartOfDay(range.Start), DateEx.GetEndOfDay(range.End));
            yield return req;
            if (req.Error != null) {
                yield return HandleExceptionResult.Display(req.Error);
                this.SchedulerIsBusy = false;
                yield break;
            }
            LoadClosedDaysAppointments(req.Result);

            NotifyOfPropertyChange(() => SessionInfo.Instance.ClosedDays);
            this.SchedulerIsBusy = false;
        }
        public IEnumerable<IResult> LoadViewSchedulerClosedDays()
        {
            this.SchedulerIsBusy = true;
            var range = Scheduler.xScheduleView.VisibleRange;
            var req = new LoadBusinessClosedDaysRequest(DateEx.GetStartOfDay(range.Start), DateEx.GetEndOfDay(range.End));
            yield return req;
            if (req.Error != null) {
                yield return HandleExceptionResult.Display(req.Error);
                this.SchedulerIsBusy = false;
                yield break;
            }
            LoadClosedDaysAppointments(req.Result);

            NotifyOfPropertyChange(() => SI.ClosedDays);

            // Initialize Objects here
            // ToggleLoad
            this.SchedulerIsBusy = false;
        }
        private IEnumerable<IResult> GetClosedDays(DateTime start, DateTime end)
        {
            var closedDaysReq = new LoadBusinessClosedDaysRequest(start, end);
            yield return closedDaysReq;
            if (closedDaysReq.Error != null) {
                yield return HandleExceptionResult.Display(closedDaysReq.Error);
                this.SchedulerIsBusy = false;
                yield break;
            }

            LoadClosedDays(closedDaysReq.Result);
            Caliburn.Micro.Execute.OnUIThread(() => NotifyOfPropertyChange(() => SessionInfo.Instance.SchedulerSpecialSlots));
        }
        public IEnumerable<IResult> LoadViewScheduler()
        {
            this.SchedulerIsBusy = true;

            // Rebuild Calendars and Resources
            this.ResourceTypeCalendar = new ResourceType();
            this.ResourceTypes.Clear();
            ResourceTypeCalendar.DisplayName = "Calendar";
            ResourceTypeCalendar.Name = "Calendar";
            this.ResourceCalendars = new ResourceCollection();
            this.SchedulerCategories.Clear();
            if (Lib.ListService.Instance.ScheduleCalendars != null) {
                foreach (var sc in Lib.ListService.Instance.ScheduleCalendars) {
                    this.schedulerCategories.Add(new Category(sc.CalendarName, UILib.GetSolidColorBrushFromString(sc.ColorString)));
                    this.ResourceCalendars.Add(new Resource(sc.CalendarName, ResourceTypeCalendar.Name));
                }
            }
            ResourceTypeCalendar.Resources.AddRange(this.ResourceCalendars);
            this.ResourceTypes.Add(ResourceTypeCalendar);

            var range = Scheduler.xScheduleView.VisibleRange;

            var req = new GetAppointmentsRequest(DateEx.GetStartOfDay(range.Start), DateEx.GetEndOfDay(range.End));
            yield return req;
            if (req.Error != null) {
                yield return HandleExceptionResult.Display(req.Error);
                this.SchedulerIsBusy = false;
                yield break;
            }
            LoadAppointments(req.Result);

            var closedDaysReq = new LoadBusinessClosedDaysRequest(DateEx.GetStartOfDay(range.Start), DateEx.GetEndOfDay(range.End));
            yield return closedDaysReq;
            if (closedDaysReq.Error != null) {
                yield return HandleExceptionResult.Display(closedDaysReq.Error);
                this.SchedulerIsBusy = false;
                yield break;
            }

            LoadClosedDays(closedDaysReq.Result);
            NotifyOfPropertyChange(() => ResourceTypes);
            NotifyOfPropertyChange(() => ResourceCalendars);
            NotifyOfPropertyChange(() => SI.Appointments);

            // Initialize Objects here
            // ToggleLoad
            this.SchedulerIsBusy = false;
        }
        public IEnumerable<IResult> SchedulerVisibleRangeChanged(object sender, EventArgs e)
        {
            // Provides the New Range for the Scheduler
            this.SchedulerIsBusy = true;
            var range = (sender as RadScheduleView).VisibleRange;
            //GetAppointments(DateEx.GetStartOfDay(range.Start), DateEx.GetEndOfDay(range.End)).AsCoroutine();
            var req = new GetAppointmentsRequest(DateEx.GetStartOfDay(range.Start), DateEx.GetEndOfDay(range.End));
            yield return req;
            if (req.Error != null) {
                yield return HandleExceptionResult.Display(req.Error);
                this.SchedulerIsBusy = false;
                yield break;
            }
            LoadAppointments(req.Result);

            var closedDaysReq = new LoadBusinessClosedDaysRequest(DateEx.GetStartOfDay(range.Start), DateEx.GetEndOfDay(range.End));
            yield return closedDaysReq;
            if (closedDaysReq.Error != null) {
                yield return HandleExceptionResult.Display(closedDaysReq.Error);
                this.SchedulerIsBusy = false;
                yield break;
            }

            LoadClosedDays(closedDaysReq.Result);
            //GetClosedDays(range.Start, range.End).AsCoroutine();
            NotifyOfPropertyChange(() => ResourceTypes);
            NotifyOfPropertyChange(() => ResourceCalendars);
            NotifyOfPropertyChange(() => SessionInfo.Instance.Appointments);
            NotifyOfPropertyChange(() => SessionInfo.Instance.SchedulerSpecialSlots);
            this.SchedulerIsBusy = false;
        }