62 lines
2.8 KiB
XML
62 lines
2.8 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.AddGroupDialog"
|
||
x:DataType="vm:AddGroupDialogViewModel"
|
||
Title="Neue Lerngruppe"
|
||
Width="420" SizeToContent="Height"
|
||
CanResize="False" WindowStartupLocation="CenterOwner">
|
||
|
||
<Grid RowDefinitions="*,Auto" Margin="24">
|
||
<StackPanel Grid.Row="0" Spacing="14">
|
||
<TextBlock Text="Neue Lerngruppe anlegen" FontSize="18" FontWeight="SemiBold"/>
|
||
|
||
<!-- Typ: Klasse oder Kurs -->
|
||
<StackPanel Spacing="4">
|
||
<TextBlock Text="Typ *" FontSize="12" Opacity="0.7"/>
|
||
<ComboBox ItemsSource="{Binding TypeOptions}"
|
||
SelectedItem="{Binding SelectedTypeName}"
|
||
HorizontalAlignment="Stretch"/>
|
||
</StackPanel>
|
||
|
||
<!-- Bezeichnung – Label und Placeholder reagieren auf den Typ -->
|
||
<StackPanel Spacing="4">
|
||
<TextBlock Text="{Binding NameLabel}" FontSize="12" Opacity="0.7"/>
|
||
<TextBox Text="{Binding Name}" PlaceholderText="{Binding NameHint}"/>
|
||
</StackPanel>
|
||
|
||
<!-- Fach – nur bei Kurs, AutoComplete aus bekannten Fächern -->
|
||
<StackPanel Spacing="4" IsVisible="{Binding IsKurs}">
|
||
<TextBlock Text="Fach (optional)" FontSize="12" Opacity="0.7"/>
|
||
<AutoCompleteBox Text="{Binding Subject}"
|
||
ItemsSource="{Binding KnownSubjectNames}"
|
||
FilterMode="Contains"
|
||
MinimumPrefixLength="0"
|
||
PlaceholderText="z.B. Chemie, Mathematik"
|
||
HorizontalAlignment="Stretch"/>
|
||
</StackPanel>
|
||
|
||
<Grid ColumnDefinitions="*,12,*">
|
||
<StackPanel Grid.Column="0" Spacing="4">
|
||
<TextBlock Text="Klassenstufe *" FontSize="12" Opacity="0.7"/>
|
||
<NumericUpDown Value="{Binding GradeLevel}" Minimum="1" Maximum="13" FormatString="0"/>
|
||
</StackPanel>
|
||
<StackPanel Grid.Column="2" Spacing="4">
|
||
<TextBlock Text="Schuljahr" FontSize="12" Opacity="0.7"/>
|
||
<ComboBox ItemsSource="{Binding SchoolYears}"
|
||
SelectedItem="{Binding SelectedSchoolYear}"
|
||
HorizontalAlignment="Stretch"/>
|
||
</StackPanel>
|
||
</Grid>
|
||
|
||
<TextBlock Text="{Binding ValidationMessage}" Foreground="Red" FontSize="12"
|
||
IsVisible="{Binding ValidationMessage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
||
</StackPanel>
|
||
|
||
<Grid Grid.Row="1" ColumnDefinitions="*,8,*" Margin="0,20,0,0">
|
||
<Button Grid.Column="0" Content="Abbrechen" HorizontalAlignment="Stretch" Click="OnCancel"/>
|
||
<Button Grid.Column="2" Content="Anlegen" HorizontalAlignment="Stretch" Click="OnSave"/>
|
||
</Grid>
|
||
</Grid>
|
||
</Window>
|