void OnAdd() { var daySchedulePartDetailsViewModel = new DaySchedulePartDetailsViewModel(); if (DialogService.ShowModalWindow(daySchedulePartDetailsViewModel)) { DaySchedule.DayScheduleParts.Add(daySchedulePartDetailsViewModel.DaySchedulePart); if (GKScheduleHelper.SaveDaySchedule(DaySchedule, false)) { var daySchedulePartViewModel = new DaySchedulePartViewModel(daySchedulePartDetailsViewModel.DaySchedulePart); Parts.Add(daySchedulePartViewModel); SelectedPart = daySchedulePartViewModel; } } }
void OnEdit() { var daySchedulePartDetailsViewModel = new DaySchedulePartDetailsViewModel(SelectedPart.DaySchedulePart); if (DialogService.ShowModalWindow(daySchedulePartDetailsViewModel) && GKScheduleHelper.SaveDaySchedule(DaySchedule, false)) { SelectedPart.Update(); } }