Bisher war die Einheit einer Stunde nach dem Anlegen fix - bei falscher Auswahl im Erstellen-Dialog blieb nur Löschen+Neuanlegen. Neuer Button öffnet einen Dialog zur Auswahl der Ziel-Einheit; die Ansicht springt danach automatisch dorthin mit der Stunde vorausgewählt. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
22 lines
614 B
C#
22 lines
614 B
C#
using Avalonia.Controls;
|
|
using Avalonia.Interactivity;
|
|
using LehrerApp.Desktop.ViewModels.Groups;
|
|
|
|
namespace LehrerApp.Desktop.Views.Groups;
|
|
|
|
public partial class ChangeLessonUnitDialog : Window
|
|
{
|
|
public ChangeLessonUnitDialog() => InitializeComponent();
|
|
|
|
private void OnSave(object? s, RoutedEventArgs e)
|
|
{
|
|
if (DataContext is ChangeLessonUnitDialogViewModel vm && vm.SaveCommand.CanExecute(null))
|
|
{
|
|
vm.SaveCommand.Execute(null);
|
|
if (vm.Result is not null) Close(true);
|
|
}
|
|
}
|
|
|
|
private void OnCancel(object? s, RoutedEventArgs e) => Close(false);
|
|
}
|