Klausur-Deckblatt: Fortschrittsbalken und Erzeugung im Hintergrund
CI / build-and-test (push) Canceled after 0s
CI / build-and-test (push) Canceled after 0s
Ein Klassensatz dauert spürbar und fror den Dialog ein. GenerateAsync setzt jetzt per Task.Run, RenderBatchToPdf meldet jeden gesetzten Datensatz über ein optionales IProgress<int>. Das abschließende Document.Merge meldet nichts, dort läuft der Balken unbestimmt. Währenddessen sind die Schaltflächen gesperrt und der Dialog bleibt offen. Ein einzelnes Deckblatt wird nicht mehr doppelt gesetzt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
24a30881f3
commit
e4a81e8974
9 files changed
+93
-23
No files matched your search
@@ -7,7 +7,13 @@ namespace LehrerApp.Desktop.Views.Groups;
|
||||
|
||||
public partial class ExamCoverSheetDialog : Window
|
||||
{
|
||||
public ExamCoverSheetDialog() => InitializeComponent();
|
||||
public ExamCoverSheetDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
// Solange das PDF entsteht, bleibt der Dialog offen — sonst liefe die Erzeugung ohne
|
||||
// sichtbare Rückmeldung weiter.
|
||||
Closing += (_, e) => e.Cancel = DataContext is ExamCoverSheetDialogViewModel { IsGenerating: true };
|
||||
}
|
||||
|
||||
private async void OnGenerate(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
@@ -21,7 +27,7 @@ public partial class ExamCoverSheetDialog : Window
|
||||
});
|
||||
if (file is null) return;
|
||||
var path = file.Path.LocalPath;
|
||||
if (vm.Generate(path))
|
||||
if (await vm.GenerateAsync(path))
|
||||
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(path) { UseShellExecute = true });
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user