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>
30 lines
1.1 KiB
C#
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();
|
|
}
|