Files
LehrerApp/LehrerApp.Desktop/Views/Groups/AddStudentToGroupDialog.axaml
T

68 lines
2.9 KiB
XML

<Window 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.AddStudentToGroupDialog"
x:DataType="vm:AddStudentToGroupDialogViewModel"
Title="Schüler hinzufügen"
Width="420" Height="560"
CanResize="False" WindowStartupLocation="CenterOwner">
<Grid RowDefinitions="Auto,*,Auto,Auto" Margin="24">
<!-- Überschrift + Suche -->
<StackPanel Grid.Row="0" Spacing="12" Margin="0,0,0,12">
<TextBlock Text="Schüler zur Gruppe hinzufügen" FontSize="18" FontWeight="SemiBold"/>
<TextBox Text="{Binding SearchText}"
PlaceholderText="Schüler suchen …"
x:Name="SearchBox"/>
</StackPanel>
<!-- Schülerliste -->
<ListBox Grid.Row="1"
ItemsSource="{Binding AvailableStudents}"
SelectedItem="{Binding SelectedStudent}"
BorderThickness="1">
<ListBox.ItemTemplate>
<DataTemplate x:DataType="vm:StudentPickerItem">
<TextBlock Text="{Binding FullName}" Padding="4,2"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<!-- Zeitraum-Auswahl -->
<Border Grid.Row="2"
BorderBrush="{DynamicResource SystemControlForegroundBaseLowBrush}"
BorderThickness="1" CornerRadius="6" Padding="14,10" Margin="0,10,0,0">
<StackPanel Spacing="8">
<TextBlock Text="Einschreibungszeitraum" FontSize="12" FontWeight="SemiBold" Opacity="0.7"/>
<StackPanel Orientation="Horizontal" Spacing="8">
<RadioButton Content="Ganzes Jahr" IsChecked="{Binding IsFullYear}"/>
<RadioButton Content="Nur H1" IsChecked="{Binding IsH1Only}"/>
<RadioButton Content="Nur H2" IsChecked="{Binding IsH2Only}"/>
<RadioButton Content="Datum" IsChecked="{Binding IsCustom}"/>
</StackPanel>
<Grid ColumnDefinitions="*,12,*"
IsVisible="{Binding IsCustomPeriod}">
<TextBox Grid.Column="0" Text="{Binding JoinedAtText}"
PlaceholderText="Eintr. TT.MM.JJJJ" FontSize="12"/>
<TextBox Grid.Column="2" Text="{Binding LeftAtText}"
PlaceholderText="Austr. TT.MM.JJJJ" FontSize="12"/>
</Grid>
</StackPanel>
</Border>
<!-- Validation + Buttons -->
<StackPanel Grid.Row="3" Spacing="12" Margin="0,16,0,0">
<TextBlock Text="{Binding ValidationMessage}" Foreground="Red" FontSize="12"
IsVisible="{Binding ValidationMessage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
<Grid ColumnDefinitions="*,8,*">
<Button Grid.Column="0" Content="Abbrechen" HorizontalAlignment="Stretch" Click="OnCancel"/>
<Button Grid.Column="2" Content="Hinzufügen" HorizontalAlignment="Stretch" Click="OnSave"/>
</Grid>
</StackPanel>
</Grid>
</Window>