KI-Backend: Antwortretten - Funktion
CI / build-and-test (push) Canceled after 0s

This commit is contained in:
2026-09-04 12:10:42 +02:00
parent 7ef0c95a73
commit fedfceb81d
10 changed files with 435 additions and 14 deletions
@@ -0,0 +1,35 @@
using Avalonia.Controls;
using Avalonia.Interactivity;
using LehrerApp.Desktop.ViewModels.Groups;
namespace LehrerApp.Desktop.Views.Groups;
public partial class AiResponseRescueDialog : Window
{
public AiResponseRescueDialog() => InitializeComponent();
private void OnValidateSelection(object? sender, RoutedEventArgs e)
{
if (DataContext is not AiResponseRescueDialogViewModel vm) return;
var candidate = string.IsNullOrWhiteSpace(ResponseTextBox.SelectedText)
? ResponseTextBox.Text ?? ""
: ResponseTextBox.SelectedText;
vm.ParseSelection(candidate);
}
private void OnImportIntoExisting(object? sender, RoutedEventArgs e)
{
if (DataContext is not AiResponseRescueDialogViewModel vm || !vm.CanImportIntoExisting) return;
vm.ImportIntoExistingCommand.Execute(null);
if (vm.Result) Close(true);
}
private void OnImportAsNew(object? sender, RoutedEventArgs e)
{
if (DataContext is not AiResponseRescueDialogViewModel vm || !vm.HasParsedLesson) return;
vm.ImportAsNewCommand.Execute(null);
if (vm.Result) Close(true);
}
private void OnCancel(object? sender, RoutedEventArgs e) => Close(false);
}