Initial
This commit is contained in:
33
LehrerApp.Desktop/Views/Groups/AddGroupDialog.axaml.cs
Normal file
33
LehrerApp.Desktop/Views/Groups/AddGroupDialog.axaml.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
|
||||
namespace LehrerApp.Desktop.Views.Groups;
|
||||
|
||||
public partial class AddGroupDialog : Window
|
||||
{
|
||||
public bool Saved { get; private set; }
|
||||
|
||||
public AddGroupDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void OnSave(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is ViewModels.Groups.AddGroupDialogViewModel vm)
|
||||
{
|
||||
if (vm.SaveCommand.CanExecute(null))
|
||||
{
|
||||
vm.SaveCommand.Execute(null);
|
||||
if (vm.Result is not null)
|
||||
{
|
||||
Saved = true;
|
||||
Close(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnCancel(object? sender, RoutedEventArgs e) =>
|
||||
Close(false);
|
||||
}
|
||||
Reference in New Issue
Block a user