This commit is contained in:
1 parent
c79d96c5ec
commit
d4b1419f9a
7 files changed
+951
No files matched your search
@@ -23,6 +23,7 @@ public partial class MainWindow : Window
|
||||
private bool _finalSyncStarted;
|
||||
private bool _closeAfterFinalSync;
|
||||
private RandomStudentPickerWindow? _randomStudentPickerWindow;
|
||||
private StudentGroupGeneratorWindow? _studentGroupGeneratorWindow;
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
@@ -93,6 +94,28 @@ public partial class MainWindow : Window
|
||||
_randomStudentPickerWindow.Show();
|
||||
}
|
||||
|
||||
private void OnOpenStudentGroupGenerator(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
|
||||
{
|
||||
if (_studentGroupGeneratorWindow is not null)
|
||||
{
|
||||
_studentGroupGeneratorWindow.Activate();
|
||||
return;
|
||||
}
|
||||
|
||||
var currentGroupId = (DataContext as MainWindowViewModel)?.CurrentGroupDetail?.Group?.Id;
|
||||
var vm = new StudentGroupGeneratorViewModel(
|
||||
App.Services.GetRequiredService<IStudentRepository>(),
|
||||
App.Services.GetRequiredService<IGroupRepository>(),
|
||||
App.Services.GetRequiredService<IGroupMembershipRepository>(),
|
||||
App.Services.GetRequiredService<IParticipationSessionRepository>(),
|
||||
App.Services.GetRequiredService<IParticipationRepository>(),
|
||||
App.Services.GetRequiredService<IGradeRepository>(),
|
||||
currentGroupId);
|
||||
_studentGroupGeneratorWindow = new StudentGroupGeneratorWindow { DataContext = vm };
|
||||
_studentGroupGeneratorWindow.Closed += (_, _) => _studentGroupGeneratorWindow = null;
|
||||
_studentGroupGeneratorWindow.Show();
|
||||
}
|
||||
|
||||
private void OnWindowKeyDown(object? sender, KeyEventArgs e)
|
||||
{
|
||||
if (DataContext is not MainWindowViewModel vm) return;
|
||||
|
||||
Reference in new issue
Block a user