123 lines
6.1 KiB
XML
123 lines
6.1 KiB
XML
<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" Classes="dialogtitle"/>
|
||
|
||
<!-- 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"/>
|
||
<TextBlock Text="{Binding LastNameError}" Foreground="Red" FontSize="11"
|
||
IsVisible="{Binding LastNameError, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
||
</StackPanel>
|
||
<StackPanel Grid.Column="2" Spacing="4">
|
||
<TextBlock Text="Vorname *" FontSize="12" Opacity="0.7"/>
|
||
<TextBox Text="{Binding FirstName}" PlaceholderText="Max"/>
|
||
<TextBlock Text="{Binding FirstNameError}" Foreground="Red" FontSize="11"
|
||
IsVisible="{Binding FirstNameError, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
||
</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"/>
|
||
<TextBlock Text="{Binding DateOfBirthError}" Foreground="Red" FontSize="11"
|
||
IsVisible="{Binding DateOfBirthError, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
||
</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>
|
||
<TextBox Text="{Binding LetterSalutation}"
|
||
PlaceholderText="Briefanrede, z.B. Sehr geehrte Frau Mustermann,"
|
||
FontSize="12"/>
|
||
<!-- Zeile 2: Telefon + Mobiltelefon -->
|
||
<Grid ColumnDefinitions="*,10,*">
|
||
<TextBox Grid.Column="0" Text="{Binding Phone}"
|
||
PlaceholderText="Festnetz" FontSize="12"/>
|
||
<TextBox Grid.Column="2" Text="{Binding MobilePhone}"
|
||
PlaceholderText="Mobiltelefon" FontSize="12"/>
|
||
</Grid>
|
||
<TextBox Text="{Binding Email}" PlaceholderText="E-Mail" FontSize="12"/>
|
||
<!-- 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."
|
||
Classes="emptyhint"
|
||
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>
|
||
|
||
</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>
|