瀏覽代碼

Fix to threading issue

Kenric Nugteren 1 年之前
父節點
當前提交
ddcfd231a2
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      prs.desktop/Dashboards/Common/DigitalFormsDashboard.xaml.cs

+ 3 - 2
prs.desktop/Dashboards/Common/DigitalFormsDashboard.xaml.cs

@@ -743,9 +743,10 @@ namespace PRSDesktop
                 var result = dialog.ShowDialog();
                 if(result == System.Windows.Forms.DialogResult.OK && !string.IsNullOrWhiteSpace(dialog.SelectedPath))
                 {
+                    var data = DataGrid.SelectedItems.OfType<DataRowView>().Select(x => x.Row).ToList();
                     Progress.ShowModal("Saving forms", progress =>
                     {
-                        foreach (var row in DataGrid.SelectedItems.OfType<DataRowView>().Select(x => x.Row))
+                        foreach (var row in data)
                         {
                             var id = (Guid)row["ID"];
                             var number = (string)row["Number"];
@@ -758,7 +759,7 @@ namespace PRSDesktop
                             File.WriteAllBytes(Path.Combine(dialog.SelectedPath, Path.ChangeExtension(number, ".pdf")), pdfData);
                         }
                     });
-                    MessageWindow.ShowMessage("All done!");
+                    MessageWindow.ShowMessage("All done!", "Success");
                 }
             }
         }