Kapitel 7 abgeschlossen.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using LehrerApp.Desktop.ViewModels.Students;
|
||||
|
||||
namespace LehrerApp.Desktop.Views.Students;
|
||||
|
||||
public partial class ManageStudentDialog : Window
|
||||
{
|
||||
public ManageStudentDialog() => InitializeComponent();
|
||||
|
||||
private void OnDeactivate(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is not ManageStudentDialogViewModel vm) return;
|
||||
vm.DeactivateCommand.Execute(null);
|
||||
Close(vm.Result);
|
||||
}
|
||||
|
||||
private void OnReactivate(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is not ManageStudentDialogViewModel vm) return;
|
||||
vm.ReactivateCommand.Execute(null);
|
||||
Close(vm.Result);
|
||||
}
|
||||
|
||||
private void OnDeletePermanently(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is not ManageStudentDialogViewModel vm) return;
|
||||
vm.DeletePermanentlyCommand.Execute(null);
|
||||
if (vm.Result == StudentManagementResult.Deleted) Close(vm.Result);
|
||||
}
|
||||
|
||||
private void OnCancel(object? sender, RoutedEventArgs e) => Close(StudentManagementResult.Cancelled);
|
||||
}
|
||||
Reference in New Issue
Block a user