public void LoadData(object sender, DoWorkEventArgs e) { PatientList = hms.getPatientList(); DoctorList = hms.getDoctors(); NurseList = hms.getNurses(); RoomList = hms.getRooms(); IndoorList = hms.getIndoors(); this.Dispatcher.Invoke(new Action(delegate { Add_Employee.IsEnabled = true; Add_Patient.IsEnabled = true; btnAdd_Nurse.IsEnabled = true; btnAdd_Room.IsEnabled = true; dataGrid_Doctor.ItemsSource = DoctorList; dataGrid_Patient.ItemsSource = PatientList; dataGrid_Nurse.ItemsSource = NurseList; dataGrid_Room.ItemsSource = RoomList; dataGrid_Indoor.ItemsSource = IndoorList; cboGovernedBy.ItemsSource = NurseList; cboRoomNo.ItemsSource = RoomList; cboCategory.ItemsSource = hms.getCategories(); })); }