private void RefreshList() { this.DoneWashDays.Children.Clear(); var instances = mMainSessionController.GetInstances(); var orderedList = instances.OrderBy(x => x.Day); foreach (var d in orderedList) { var def = mMainSessionController.GetWashingDayById(d.WashDayID); var c = new WashingDayInstanceCalendarCell(d, def, App.BL); c.HeaderExtensionRight = new Label { Text = d.Day.ToLongDateString() }; c.Openclicked += C_Openclicked; c.ImageClicked += C_ImageClicked; this.DoneWashDays.Children.Add(c.View); } }
private void RefreshList(DateTime date) { PlanedWashDaysContainer.IsVisible = false; DoneWashDaysContainer.IsVisible = false; this.PlanedWashDays.Children.Clear(); var futureDays = mMainSessionController.GetFutureDays(); var instances = mMainSessionController.GetInstancesByDate(); if (futureDays.ContainsKey(date)) { if (date >= ScheduleController.GetToday()) { PlanedWashDaysContainer.IsVisible = true; foreach (var d in futureDays[date]) { var wdController = new WashingDayEditorController(d, App.MainSession.GetAllDefinitions(), mAlarmController); var c = new WashingDayDefinitionControl(wdController, App.BL); c.Edited += WashingDayEdited; c.Removed += C_Removed; this.PlanedWashDays.Children.Add(c.View); } } } this.DoneWashDays.Children.Clear(); if (instances.ContainsKey(date)) { PlanedWashDaysContainer.IsVisible = false; DoneWashDaysContainer.IsVisible = true; foreach (var d in instances[date]) { var def = mMainSessionController.GetWashingDayById(d.WashDayID); var c = new WashingDayInstanceCalendarCell(d, def, App.BL); c.Openclicked += C_Openclicked; c.ImageClicked += C_ImageClicked; this.DoneWashDays.Children.Add(c.View); } } }