Files
LehrerApp/LehrerApp.Desktop/Views/Groups/ExamCoverSheetDialog.axaml.cs
T
adminandClaude Opus 5.5 dd92128464 Klausur-Deckblätter als Sammel-PDF aus Vorlagen vom Typ exam-cover
Neuer Dialog "Deckblätter…" bei Klausuren, Punktetabelle als Drawing mit
festen Spaltenbreiten, FLOWDRAWBOX-Attribut fit=content, Stapel-Rendering
mit Seitenzahl je Datensatz, Kursbezeichnung und konfigurierbares Kürzel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 10:39:09 +02:00

30 lines
1.1 KiB
C#

using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Platform.Storage;
using LehrerApp.Desktop.ViewModels.Groups;
namespace LehrerApp.Desktop.Views.Groups;
public partial class ExamCoverSheetDialog : Window
{
public ExamCoverSheetDialog() => InitializeComponent();
private async void OnGenerate(object? sender, RoutedEventArgs e)
{
if (DataContext is not ExamCoverSheetDialogViewModel vm) return;
var file = await StorageProvider.SaveFilePickerAsync(new FilePickerSaveOptions
{
Title = "Deckblätter speichern",
SuggestedFileName = vm.SuggestedFileName,
DefaultExtension = "pdf",
FileTypeChoices = [new FilePickerFileType("PDF") { Patterns = ["*.pdf"] }],
});
if (file is null) return;
var path = file.Path.LocalPath;
if (vm.Generate(path))
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(path) { UseShellExecute = true });
}
private void OnClose(object? sender, RoutedEventArgs e) => Close();
}