private async void Start() { NewExaminationM = new NewExaminationM(); NewExaminationM.PatientId = (GlobalVM.StockLayout.headerContent.Content as SelectedPatient).SelectedPatientVM.Id(); NewExaminationM.ExaminationCode = await new Codes().Generate((int)GlobalVM.GlobalM.UserID, NewExaminationM.PatientId); NewExaminationM.ExaminationDate = DateTime.Now; Loading = new BackgroundWorker(); Loading.DoWork += new DoWorkEventHandler(LoadingModel); Loading.RunWorkerCompleted += new RunWorkerCompletedEventHandler(LoadingModelComplete); Loading.RunWorkerAsync(); }
private async void LoadingModelComplete(object sender, RunWorkerCompletedEventArgs e) { if (workingConn) { foreach (object row in NewExaminationM.ExaminationList) { (row as DocumentControlM.ListElement).AcceptChanges(); } NewExaminationM.AcceptChanges(); } else { ConnectionMessage(); } await Utilities.Loading.Hide(); }