Kapitel 7 abgeschlossen.
This commit is contained in:
@@ -58,7 +58,7 @@ public partial class ParticipationTabView : UserControl
|
||||
{
|
||||
Header = $"{aspect.Label} [{AspectShortcut(i)}]",
|
||||
Width = new DataGridLength(1, DataGridLengthUnitType.Star),
|
||||
CellTemplate = BuildCellTemplate(idx, forCompetency: false),
|
||||
CellTemplate = BuildCellTemplate(idx, forCompetency: false, _vm.IsReadOnly),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -66,13 +66,13 @@ public partial class ParticipationTabView : UserControl
|
||||
{
|
||||
Header = "HA",
|
||||
Width = new DataGridLength(50, DataGridLengthUnitType.Pixel),
|
||||
CellTemplate = BuildHomeworkCellTemplate(),
|
||||
CellTemplate = BuildHomeworkCellTemplate(_vm.IsReadOnly),
|
||||
});
|
||||
grid.Columns.Add(new DataGridTemplateColumn
|
||||
{
|
||||
Header = "Anwesenheit",
|
||||
Width = new DataGridLength(80, DataGridLengthUnitType.Pixel),
|
||||
CellTemplate = BuildAttendanceCellTemplate(),
|
||||
CellTemplate = BuildAttendanceCellTemplate(_vm.IsReadOnly),
|
||||
});
|
||||
|
||||
// Kompetenz-Spalten (opt-in)
|
||||
@@ -85,13 +85,13 @@ public partial class ParticipationTabView : UserControl
|
||||
{
|
||||
Header = code,
|
||||
Width = new DataGridLength(80, DataGridLengthUnitType.Pixel),
|
||||
CellTemplate = BuildCellTemplate(idx, forCompetency: true),
|
||||
CellTemplate = BuildCellTemplate(idx, forCompetency: true, _vm.IsReadOnly),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static IDataTemplate BuildCellTemplate(int cellIndex, bool forCompetency)
|
||||
private static IDataTemplate BuildCellTemplate(int cellIndex, bool forCompetency, bool isReadOnly)
|
||||
{
|
||||
return new FuncDataTemplate<ParticipationStudentRow>((row, _) =>
|
||||
{
|
||||
@@ -119,6 +119,7 @@ public partial class ParticipationTabView : UserControl
|
||||
Padding = new Avalonia.Thickness(5, 1),
|
||||
FontSize = 11,
|
||||
Opacity = cell.Value == val ? 1.0 : 0.3,
|
||||
IsEnabled = !isReadOnly,
|
||||
};
|
||||
var capturedVal = val;
|
||||
btn.Click += (_, _) => cell.SetValue(capturedVal);
|
||||
@@ -134,7 +135,7 @@ public partial class ParticipationTabView : UserControl
|
||||
});
|
||||
}
|
||||
|
||||
private static IDataTemplate BuildHomeworkCellTemplate()
|
||||
private static IDataTemplate BuildHomeworkCellTemplate(bool isReadOnly)
|
||||
{
|
||||
return new FuncDataTemplate<ParticipationStudentRow>((row, _) =>
|
||||
{
|
||||
@@ -147,6 +148,7 @@ public partial class ParticipationTabView : UserControl
|
||||
Height = 26,
|
||||
Padding = new Avalonia.Thickness(3, 1),
|
||||
Command = row.ToggleHomeworkCommand,
|
||||
IsEnabled = !isReadOnly,
|
||||
};
|
||||
void RefreshHomework()
|
||||
{
|
||||
@@ -180,7 +182,7 @@ public partial class ParticipationTabView : UserControl
|
||||
});
|
||||
}
|
||||
|
||||
private static IDataTemplate BuildAttendanceCellTemplate()
|
||||
private static IDataTemplate BuildAttendanceCellTemplate(bool isReadOnly)
|
||||
{
|
||||
return new FuncDataTemplate<ParticipationStudentRow>((row, _) =>
|
||||
{
|
||||
@@ -193,6 +195,7 @@ public partial class ParticipationTabView : UserControl
|
||||
Height = 26,
|
||||
Padding = new Avalonia.Thickness(3, 1),
|
||||
Command = row.CycleAttendanceCommand,
|
||||
IsEnabled = !isReadOnly,
|
||||
};
|
||||
void RefreshAttendance()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user