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