public ScheduleProcedureViewModel(ScheduleProcedure scheduleProcedure, Procedure callingProcedure = null) { CallingProcedure = callingProcedure; ScheduleProcedure = scheduleProcedure; Procedure = ClientManager.SystemConfiguration.AutomationConfiguration.Procedures.FirstOrDefault(x => x.Uid == scheduleProcedure.ProcedureUid); if (Procedure != null) UpdateArguments(); }
public override void UpdateContent() { ScheduleProcedures = new ObservableCollection<ScheduleProcedureViewModel>(); foreach (var procedure in ClientManager.SystemConfiguration.AutomationConfiguration.Procedures.FindAll(x => x.Uid != Procedure.Uid)) { var scheduleProcedure = new ScheduleProcedure { ProcedureUid = procedure.Uid }; if (procedure.Uid == ProcedureSelectionStep.ScheduleProcedure.ProcedureUid) scheduleProcedure = ProcedureSelectionStep.ScheduleProcedure; ScheduleProcedures.Add(new ScheduleProcedureViewModel(scheduleProcedure, Procedure)); } SelectedScheduleProcedure = ScheduleProcedures.FirstOrDefault(x => x.ScheduleProcedure.ProcedureUid == ProcedureSelectionStep.ScheduleProcedure.ProcedureUid); OnPropertyChanged(() => ScheduleProcedures); }
public ProcedureSelectionStep() { ScheduleProcedure = new ScheduleProcedure(); }
void OnAdd() { var procedureSelectionViewModel = new ProcedureSelectionViewModel(); if (DialogService.ShowModalWindow(procedureSelectionViewModel)) { if (procedureSelectionViewModel.SelectedProcedure != null) { var scheduleProcedure = new ScheduleProcedure(); scheduleProcedure.ProcedureUid = procedureSelectionViewModel.SelectedProcedure.Procedure.Uid; var scheduleProcedureViewModel = new ScheduleProcedureViewModel(scheduleProcedure); ScheduleProcedures.Add(scheduleProcedureViewModel); Schedule.ScheduleProcedures.Add(scheduleProcedureViewModel.ScheduleProcedure); SelectedScheduleProcedure = scheduleProcedureViewModel; ServiceFactory.SaveService.AutomationChanged = true; } } }