Initial
This commit is contained in:
148
LehrerApp.Desktop/Views/Students/StudentDetailView.axaml
Normal file
148
LehrerApp.Desktop/Views/Students/StudentDetailView.axaml
Normal file
@@ -0,0 +1,148 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="clr-namespace:LehrerApp.Desktop.ViewModels.Students"
|
||||
x:Class="LehrerApp.Desktop.Views.Students.StudentDetailView"
|
||||
x:DataType="vm:StudentDetailViewModel">
|
||||
|
||||
<Grid RowDefinitions="Auto,Auto,*">
|
||||
|
||||
<!-- ── Header ──────────────────────────────────────────────────────── -->
|
||||
<Border Grid.Row="0" Padding="20,16"
|
||||
BorderBrush="{DynamicResource SystemControlForegroundBaseLowBrush}"
|
||||
BorderThickness="0,0,0,1">
|
||||
<Grid ColumnDefinitions="*,Auto">
|
||||
|
||||
<!-- Anzeigemodus -->
|
||||
<StackPanel Grid.Column="0"
|
||||
IsVisible="{Binding !IsEditing}">
|
||||
<TextBlock Text="{Binding StudentTitle}"
|
||||
FontSize="22" FontWeight="SemiBold"/>
|
||||
<TextBlock Text="{Binding Student.DateOfBirth,
|
||||
StringFormat='Geb. {0:dd.MM.yyyy}',
|
||||
FallbackValue=''}"
|
||||
FontSize="12" Opacity="0.5"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Bearbeitungsmodus -->
|
||||
<StackPanel Grid.Column="0" Spacing="6"
|
||||
IsVisible="{Binding IsEditing}">
|
||||
<Grid ColumnDefinitions="*,8,*">
|
||||
<TextBox Grid.Column="0"
|
||||
Text="{Binding EditFirstName}"
|
||||
Watermark="Vorname"/>
|
||||
<TextBox Grid.Column="2"
|
||||
Text="{Binding EditLastName}"
|
||||
Watermark="Nachname"/>
|
||||
</Grid>
|
||||
<TextBox Text="{Binding EditNotes}"
|
||||
Watermark="Interne Notiz (optional)"
|
||||
AcceptsReturn="True" MaxHeight="80"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Aktions-Buttons -->
|
||||
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="8"
|
||||
VerticalAlignment="Top">
|
||||
<Button Content="Bearbeiten"
|
||||
Command="{Binding StartEditCommand}"
|
||||
IsVisible="{Binding !IsEditing}"/>
|
||||
<Button Content="Speichern"
|
||||
Command="{Binding SaveEditCommand}"
|
||||
IsVisible="{Binding IsEditing}"/>
|
||||
<Button Content="Abbrechen"
|
||||
Command="{Binding CancelEditCommand}"
|
||||
IsVisible="{Binding IsEditing}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- ── Tab-Leiste ──────────────────────────────────────────────────── -->
|
||||
<Border Grid.Row="1"
|
||||
BorderBrush="{DynamicResource SystemControlForegroundBaseLowBrush}"
|
||||
BorderThickness="0,0,0,1" Padding="16,0">
|
||||
<StackPanel Orientation="Horizontal" Spacing="4">
|
||||
<Button Content="Übersicht"
|
||||
Command="{Binding SwitchTabCommand}"
|
||||
CommandParameter="{x:Static vm:StudentTab.Overview}"
|
||||
Background="Transparent" Padding="12,8"/>
|
||||
<Button Content="Noten"
|
||||
Command="{Binding SwitchTabCommand}"
|
||||
CommandParameter="{x:Static vm:StudentTab.Grades}"
|
||||
Background="Transparent" Padding="12,8"/>
|
||||
<Button Content="Dokumentation"
|
||||
Command="{Binding SwitchTabCommand}"
|
||||
CommandParameter="{x:Static vm:StudentTab.Documentation}"
|
||||
Background="Transparent" Padding="12,8"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- ── Tab-Inhalt ──────────────────────────────────────────────────── -->
|
||||
<ScrollViewer Grid.Row="2" Padding="20">
|
||||
|
||||
<!-- Übersicht: Lerngruppen-Verlauf -->
|
||||
<StackPanel IsVisible="{Binding ActiveTab,
|
||||
Converter={x:Static ObjectConverters.Equal},
|
||||
ConverterParameter={x:Static vm:StudentTab.Overview}}"
|
||||
Spacing="16">
|
||||
|
||||
<TextBlock Text="Lerngruppen" FontSize="15" FontWeight="SemiBold"/>
|
||||
<ItemsControl ItemsSource="{Binding Enrollments}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="vm:EnrollmentEntry">
|
||||
<Border Background="{DynamicResource SystemControlBackgroundAltHighBrush}"
|
||||
CornerRadius="6" Padding="12,8" Margin="0,0,0,6">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto">
|
||||
<TextBlock Grid.Column="0"
|
||||
Text="{Binding SchoolYear}"
|
||||
FontWeight="SemiBold" Width="70"/>
|
||||
<TextBlock Grid.Column="1"
|
||||
Text="{Binding GroupName}"
|
||||
Margin="8,0"/>
|
||||
<TextBlock Grid.Column="2"
|
||||
Text="{Binding Subject}"
|
||||
Opacity="0.5" FontSize="12"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
<TextBlock Text="{Binding Student.Notes}"
|
||||
IsVisible="{Binding Student.Notes,
|
||||
Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
|
||||
Opacity="0.7" FontSize="13"
|
||||
TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Dokumentation -->
|
||||
<ItemsControl IsVisible="{Binding ActiveTab,
|
||||
Converter={x:Static ObjectConverters.Equal},
|
||||
ConverterParameter={x:Static vm:StudentTab.Documentation}}"
|
||||
ItemsSource="{Binding Documentation}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="vm:DocEntry">
|
||||
<Border Background="{DynamicResource SystemControlBackgroundAltHighBrush}"
|
||||
CornerRadius="6" Padding="12,10" Margin="0,0,0,8">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto">
|
||||
<TextBlock Grid.Column="0"
|
||||
Text="{Binding Date}"
|
||||
Opacity="0.5" FontSize="12" Width="80"/>
|
||||
<StackPanel Grid.Column="1" Margin="8,0">
|
||||
<TextBlock Text="{Binding Title}"
|
||||
FontWeight="SemiBold" FontSize="13"/>
|
||||
<TextBlock Text="{Binding TypeLabel}"
|
||||
FontSize="11" Opacity="0.5"/>
|
||||
</StackPanel>
|
||||
<TextBlock Grid.Column="2"
|
||||
Text="🔒" FontSize="14"
|
||||
IsVisible="{Binding IsConfidential}"
|
||||
ToolTip.Tip="Vertraulich"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
Reference in New Issue
Block a user