Schüler hinzufügen, Kompetenzen

This commit is contained in:
2026-06-23 13:46:39 +02:00
parent b2211270b4
commit 220969fdfa
23 changed files with 1230 additions and 88 deletions
@@ -1,3 +1,26 @@
using Avalonia.Controls;
using LehrerApp.Desktop.ViewModels.Groups;
using Microsoft.Extensions.DependencyInjection;
namespace LehrerApp.Desktop.Views.Groups;
public partial class GroupListView : UserControl { public GroupListView() => InitializeComponent(); }
public partial class GroupListView : UserControl
{
public GroupListView() => InitializeComponent();
protected override void OnDataContextChanged(EventArgs e)
{
base.OnDataContextChanged(e);
if (DataContext is GroupListViewModel vm)
vm.OnAddGroup = ShowAddGroupDialog;
}
private async Task ShowAddGroupDialog()
{
var dialogVm = App.Services.GetRequiredService<AddGroupDialogViewModel>();
var dialog = new AddGroupDialog { DataContext = dialogVm };
var owner = TopLevel.GetTopLevel(this) as Window;
if (owner is not null)
await dialog.ShowDialog(owner);
}
}