private void Date_Changed(object sender, SelectionChangedEventArgs e) { if (date.SelectedDate != null && time.SelectedIndex != -1) { ComboBoxItem item = time.SelectedItem as ComboBoxItem; DateTime start = DateTime.Parse(date.Text + " " + item.Content.ToString()); RoomComboBox.ItemsSource = _roomController.GetAvailableRoomList(start, start.AddMinutes(15)); DoctorComboBox.ItemsSource = _doctorControler.GetAvailableDoctorList(start, start.AddMinutes(15)); PatientComboBox.ItemsSource = _patientController.GetAvailablePatientList(start, start.AddMinutes(15)); } ConfirmCheck(); }