diff --git a/LehrerApp.Desktop/ViewModels/Groups/GroupViewModels.cs b/LehrerApp.Desktop/ViewModels/Groups/GroupViewModels.cs index 37ea713..e9cba7e 100644 --- a/LehrerApp.Desktop/ViewModels/Groups/GroupViewModels.cs +++ b/LehrerApp.Desktop/ViewModels/Groups/GroupViewModels.cs @@ -167,6 +167,13 @@ public partial class GroupDetailViewModel : ObservableObject [ObservableProperty] private StudentSummary? _selectedStudent; [ObservableProperty] private ExamSummary? _selectedExam; + // Eigene Property statt "Group.IsDifferentiated" im Binding-Pfad: die View bindet bereits, + // bevor LoadGroup() läuft (siehe MainWindowViewModel.NavigateToGroupDetail), Group ist dann + // kurzzeitig null — ein verschachtelter Pfad würde dafür jedes Mal einen Binding-Fehler loggen. + public bool IsDifferentiated => Group?.IsDifferentiated ?? false; + + partial void OnGroupChanged(LearningGroup? value) => OnPropertyChanged(nameof(IsDifferentiated)); + public ObservableCollection Students { get; } = []; public ObservableCollection Exams { get; } = []; diff --git a/LehrerApp.Desktop/Views/Groups/GroupDetailView.axaml b/LehrerApp.Desktop/Views/Groups/GroupDetailView.axaml index d052fab..90ff12f 100644 --- a/LehrerApp.Desktop/Views/Groups/GroupDetailView.axaml +++ b/LehrerApp.Desktop/Views/Groups/GroupDetailView.axaml @@ -57,7 +57,7 @@ + IsVisible="{Binding IsDifferentiated}"> + IsVisible="{Binding IsDifferentiated}"/>