protected internal ExaminationsVM(System.Action Loaded)
 {
     this.Loaded             = Loaded;
     SelectedPatient         = GlobalVM.StockLayout.headerContent.Content as SelectedPatient;
     ExaminationsM           = new ExaminationsM();
     ExaminationsM.PatientId = SelectedPatient.SelectedPatientVM.SelectedPatientM.Id;
     Loading                     = new BackgroundWorker();
     Loading.DoWork             += new DoWorkEventHandler(LoadingModel);
     Loading.RunWorkerCompleted += new RunWorkerCompletedEventHandler(LoadingModelComplete);
     Loading.RunWorkerAsync();
 }
 private void LoadingModelComplete(object sender, RunWorkerCompletedEventArgs e)
 {
     if (workingConn)
     {
         foreach (ExaminationsM.Examination row in ExaminationsM.Examinations)
         {
             row.AcceptChanges();
         }
         ExaminationsM.AcceptChanges();
         Loaded();
     }
     else
     {
         ConnectionMessage();
     }
 }
        private void ExecuteComplete(object sender, RunWorkerCompletedEventArgs e)
        {
            if (workingConn)
            {
                ExaminationsM.Erased.Clear();
                foreach (ExaminationsM.Examination row in ExaminationsM.Examinations)
                {
                    row.AcceptChanges();
                }
                ExaminationsM.AcceptChanges();

                dialog         = new Dialog(false, "Módosítások mentése", async() => await Utilities.Loading.Hide());
                dialog.content = new TextBlock("A módosítások mentése sikeresen megtörtént");
                dialog.Start();
            }
            else
            {
                ConnectionMessage();
            }
        }