101 lines
4.3 KiB
XML
101 lines
4.3 KiB
XML
<UserControl xmlns="https://github.com/avaloniaui"
|
||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||
xmlns:vm="clr-namespace:LehrerApp.Desktop.ViewModels.Groups"
|
||
x:Class="LehrerApp.Desktop.Views.Groups.GroupListView"
|
||
x:DataType="vm:GroupListViewModel">
|
||
|
||
<Grid RowDefinitions="Auto,*">
|
||
|
||
<!-- ── Toolbar ─────────────────────────────────────────────────────── -->
|
||
<Border Grid.Row="0" Padding="20,16"
|
||
BorderBrush="{DynamicResource SystemControlForegroundBaseLowBrush}"
|
||
BorderThickness="0,0,0,1">
|
||
<Grid ColumnDefinitions="*,Auto,Auto">
|
||
|
||
<StackPanel Grid.Column="0">
|
||
<TextBlock Text="Lerngruppen" FontSize="22" FontWeight="SemiBold"/>
|
||
<TextBlock FontSize="12" Opacity="0.5">
|
||
<Run Text="{Binding Groups.Count}"/>
|
||
<Run Text="Gruppen ·"/>
|
||
<Run Text="{Binding SelectedSchoolYear}"/>
|
||
</TextBlock>
|
||
</StackPanel>
|
||
|
||
<!-- Schuljahr-Auswahl -->
|
||
<ComboBox Grid.Column="1"
|
||
ItemsSource="{Binding SchoolYears}"
|
||
SelectedItem="{Binding SelectedSchoolYear}"
|
||
Width="100" Margin="0,0,8,0"
|
||
VerticalAlignment="Center"/>
|
||
|
||
<!-- Neue Gruppe -->
|
||
<Button Grid.Column="2"
|
||
Content="+ Neue Gruppe"
|
||
Command="{Binding AddGroupCommand}"
|
||
VerticalAlignment="Center"/>
|
||
</Grid>
|
||
</Border>
|
||
|
||
<!-- ── Inhalt ──────────────────────────────────────────────────────── -->
|
||
<Grid Grid.Row="1" ColumnDefinitions="260,*">
|
||
|
||
<!-- Suchliste links -->
|
||
<Border Grid.Column="0"
|
||
BorderBrush="{DynamicResource SystemControlForegroundBaseLowBrush}"
|
||
BorderThickness="0,0,1,0">
|
||
<DockPanel>
|
||
<TextBox DockPanel.Dock="Top"
|
||
Text="{Binding SearchText}"
|
||
Watermark="Suchen…"
|
||
Margin="12,8"/>
|
||
<ListBox ItemsSource="{Binding Groups}"
|
||
SelectedItem="{Binding SelectedGroup}">
|
||
<ListBox.ItemTemplate>
|
||
<DataTemplate DataType="vm:GroupListItem">
|
||
<Grid ColumnDefinitions="4,*" Margin="0,4">
|
||
<Border Grid.Column="0" Width="4" CornerRadius="2"
|
||
Background="{DynamicResource SystemAccentColor}"
|
||
Margin="0,0,10,0"/>
|
||
<StackPanel Grid.Column="1">
|
||
<Grid ColumnDefinitions="*,Auto">
|
||
<TextBlock Grid.Column="0"
|
||
Text="{Binding Name}"
|
||
FontWeight="SemiBold" FontSize="13"/>
|
||
<TextBlock Grid.Column="1"
|
||
Text="{Binding TypeLabel}"
|
||
FontSize="11" Opacity="0.5"/>
|
||
</Grid>
|
||
<TextBlock Text="{Binding Subject}"
|
||
FontSize="12" Opacity="0.65"
|
||
IsVisible="{Binding Subject,
|
||
Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
||
<TextBlock Text="{Binding GradingLabel}"
|
||
FontSize="11" Opacity="0.4"/>
|
||
</StackPanel>
|
||
</Grid>
|
||
</DataTemplate>
|
||
</ListBox.ItemTemplate>
|
||
</ListBox>
|
||
</DockPanel>
|
||
</Border>
|
||
|
||
<!-- Detail rechts – Platzhalter bis Gruppe gewählt -->
|
||
<Border Grid.Column="1">
|
||
<StackPanel HorizontalAlignment="Center"
|
||
VerticalAlignment="Center"
|
||
Spacing="8"
|
||
IsVisible="{Binding !SelectedGroup}">
|
||
<TextBlock Text="Keine Gruppe ausgewählt"
|
||
FontSize="16" Opacity="0.4"
|
||
HorizontalAlignment="Center"/>
|
||
<TextBlock Text="Wähle eine Gruppe aus der Liste oder lege eine neue an."
|
||
FontSize="12" Opacity="0.3"
|
||
HorizontalAlignment="Center"/>
|
||
</StackPanel>
|
||
</Border>
|
||
|
||
</Grid>
|
||
</Grid>
|
||
|
||
</UserControl>
|