using Avalonia.Controls; using Avalonia.Interactivity; using LehrerApp.Desktop.Services; using LehrerApp.Desktop.ViewModels.Groups; using Microsoft.Extensions.DependencyInjection; namespace LehrerApp.Desktop.Views.Groups; public partial class ExamEvaluationDialog : Window { public ExamEvaluationDialog() => InitializeComponent(); private async void OnExportClick(object? sender, RoutedEventArgs e) { if (DataContext is not ExamEvaluationDialogViewModel vm) return; var topLevel = TopLevel.GetTopLevel(this); if (topLevel is null) return; var export = ExportFile.Csv("Klausurauswertung exportieren", $"Auswertung_{vm.ExamTitle}.csv", vm.ExportCsv()); await App.Services.GetRequiredService().SaveAsync(topLevel.StorageProvider, export); } private void OnClose(object? sender, RoutedEventArgs e) => Close(); }