Files
LehrerApp/LehrerApp.Desktop/Views/Students/AddStudentDialog.axaml
T

116 lines
5.5 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<Window 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.AddStudentDialog"
x:DataType="vm:AddStudentDialogViewModel"
Title="Neuer Schüler"
Width="500" Height="640"
CanResize="True" WindowStartupLocation="CenterOwner">
<Grid RowDefinitions="*,Auto" Margin="24,20,24,20">
<ScrollViewer Grid.Row="0" VerticalScrollBarVisibility="Auto">
<StackPanel Spacing="14">
<TextBlock Text="Neuen Schüler anlegen" FontSize="18" FontWeight="SemiBold"/>
<!-- Name -->
<Grid ColumnDefinitions="*,10,*">
<StackPanel Grid.Column="0" Spacing="4">
<TextBlock Text="Nachname *" FontSize="12" Opacity="0.7"/>
<TextBox Text="{Binding LastName}" PlaceholderText="Mustermann" x:Name="LastNameBox"/>
</StackPanel>
<StackPanel Grid.Column="2" Spacing="4">
<TextBlock Text="Vorname *" FontSize="12" Opacity="0.7"/>
<TextBox Text="{Binding FirstName}" PlaceholderText="Max"/>
</StackPanel>
</Grid>
<!-- Geburtsdatum + Geschlecht -->
<Grid ColumnDefinitions="*,10,*">
<StackPanel Grid.Column="0" Spacing="4">
<TextBlock Text="Geburtsdatum" FontSize="12" Opacity="0.7"/>
<TextBox Text="{Binding DateOfBirthText}" PlaceholderText="TT.MM.JJJJ"/>
</StackPanel>
<StackPanel Grid.Column="2" Spacing="4">
<TextBlock Text="Geschlecht" FontSize="12" Opacity="0.7"/>
<ComboBox ItemsSource="{Binding GenderOptions}"
SelectedItem="{Binding SelectedGender}"
HorizontalAlignment="Stretch"/>
</StackPanel>
</Grid>
<!-- Kontakte -->
<StackPanel Spacing="6">
<Grid ColumnDefinitions="*,Auto">
<TextBlock Grid.Column="0" Text="Kontakte" FontSize="14" FontWeight="SemiBold"
VerticalAlignment="Center"/>
<Button Grid.Column="1" Content=" Kontakt" Command="{Binding AddContactCommand}"
FontSize="12" Padding="8,4"/>
</Grid>
<ItemsControl ItemsSource="{Binding Contacts}">
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="vm:ContactEntryViewModel">
<Border Background="{DynamicResource SystemControlBackgroundAltHighBrush}"
CornerRadius="6" Padding="10,8" Margin="0,0,0,6">
<StackPanel Spacing="6">
<!-- Zeile 1: Name + Beziehung + Löschen -->
<Grid ColumnDefinitions="*,10,*,10,Auto">
<TextBox Grid.Column="0" Text="{Binding Name}"
PlaceholderText="Name" FontSize="12"/>
<ComboBox Grid.Column="2"
ItemsSource="{Binding $parent[Window].DataContext.RelationPresets}"
SelectedItem="{Binding Relation}"
HorizontalAlignment="Stretch" FontSize="12"/>
<Button Grid.Column="4" Content="×" Padding="6,2"
Command="{Binding RemoveCommand}" FontSize="14"/>
</Grid>
<!-- Zeile 2: Telefon + E-Mail -->
<Grid ColumnDefinitions="*,10,*">
<TextBox Grid.Column="0" Text="{Binding Phone}"
PlaceholderText="Telefon / Handy" FontSize="12"/>
<TextBox Grid.Column="2" Text="{Binding Email}"
PlaceholderText="E-Mail" FontSize="12"/>
</Grid>
<!-- Zeile 3: Adresse -->
<TextBox Text="{Binding Street}" PlaceholderText="Straße und Hausnummer" FontSize="12"/>
<Grid ColumnDefinitions="100,10,*">
<TextBox Grid.Column="0" Text="{Binding PostalCode}"
PlaceholderText="PLZ" FontSize="12"/>
<TextBox Grid.Column="2" Text="{Binding City}"
PlaceholderText="Ort" FontSize="12"/>
</Grid>
</StackPanel>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<TextBlock Text="Noch keine Kontakte. Über Kontakt hinzufügen."
Opacity="0.35" FontSize="12"
IsVisible="{Binding !Contacts.Count}"/>
</StackPanel>
<!-- Notizen -->
<StackPanel Spacing="4">
<TextBlock Text="Notizen" FontSize="12" Opacity="0.7"/>
<TextBox Text="{Binding Notes}" PlaceholderText="Interne Anmerkungen …"
AcceptsReturn="True" Height="70" TextWrapping="Wrap"/>
</StackPanel>
<!-- Validierungsfehler -->
<TextBlock Text="{Binding ValidationMessage}" Foreground="Red" FontSize="12"
IsVisible="{Binding ValidationMessage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
</StackPanel>
</ScrollViewer>
<!-- Buttons -->
<Grid Grid.Row="1" ColumnDefinitions="*,10,*" Margin="0,16,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>