public void edDaysMethod() { editDays daysEditing = new editDays(); EditDayViewModel VMEditDays = new EditDayViewModel(); daysEditing.DataContext = VMEditDays; VMEditDays.docSelected = SelectedDocNames; ObservableCollection <Times> BackUPdocTimes = new ObservableCollection <Times>(); // не менять на лист, ибо не будет обновлятся вью расписания try { foreach (var a in DoctorTimes) { BackUPdocTimes.Add(new Times { Time = a.Time, Status = a.Status }); } VMEditDays.docTimes = BackUPdocTimes; VMEditDays.WorkDays = WorkingDays; //DoctorTimes = VMEditTime.temperory; } catch (Exception) { } // ObservableCollection<Times> BackUPdocTimes = new ObservableCollection<Times>(); // не менять на лист, ибо не будет обновлятся вью расписания //try //{ // foreach (var a in DoctorTimes) // { // BackUPdocTimes.Add(new Times { Time = a.Time, Status = a.Status }); // } // VMEditTime.docTimes = BackUPdocTimes; // //DoctorTimes = VMEditTime.temperory; //} //catch (Exception) { } try { daysEditing.ShowDialog(); } catch { } }
public void edDaysMethod() { editDays daysEditing = new editDays(); if (SelectedDocNames != null) { EditDayViewModel VMEditDays = new EditDayViewModel(SelectedDocNames); daysEditing.DataContext = VMEditDays; try { daysEditing.ShowDialog(); RefreshDocTimes(); } catch { } } else { MessageBox.Show("Лікар не вибраний", "Помилка", MessageBoxButton.OK, MessageBoxImage.Warning); } }