Files
LehrerApp/LehrerApp.Desktop/Views/Settings/GradingKeyTemplateDialog.axaml
T
adminandClaude Sonnet 5 db1afff7e4 Fehlerbehandlung, Logging und feldbezogene Validierung (Kapitel 13.2)
Zentrale Exception-Behandlung (Dispatcher.UIThread.UnhandledException,
AppDomain, TaskScheduler) verhindert Abstürze und protokolliert Fehler
über AppLogger in eine rotierende Log-Datei im App-Datenverzeichnis.
Toast-Benachrichtigungen zeigen Erfolg/Fehler global an. Alle Dialoge
mit Formularfeldern zeigen Validierungsmeldungen jetzt direkt am
betroffenen Feld statt in einem Sammel-Label.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-13 12:38:30 +02:00

52 lines
2.6 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.Settings"
x:Class="LehrerApp.Desktop.Views.Settings.GradingKeyTemplateDialog"
x:DataType="vm:GradingKeyTemplateEditItem"
Title="{Binding Name}"
Width="420" SizeToContent="Height" MinHeight="300"
CanResize="False" WindowStartupLocation="CenterOwner">
<Grid RowDefinitions="*,Auto" Margin="24">
<StackPanel Grid.Row="0" Spacing="10">
<StackPanel>
<TextBlock Text="{Binding Name}" FontSize="18" FontWeight="SemiBold"/>
<TextBlock Text="{Binding GradingSystemLabel}" FontSize="12" Opacity="0.5"/>
</StackPanel>
<TextBlock Text="{Binding CompletenessWarning}" Foreground="Red" FontSize="12" TextWrapping="Wrap"
IsVisible="{Binding CompletenessWarning, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
<ItemsControl ItemsSource="{Binding Entries}">
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="vm:GradingKeyEntryVm">
<Grid ColumnDefinitions="*,Auto" Margin="0,3">
<TextBlock Grid.Column="0" Text="{Binding Display}" VerticalAlignment="Center" FontSize="13"/>
<Button Grid.Column="1" Content="×" Padding="7,2" FontSize="13" Command="{Binding DeleteCommand}"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<Grid ColumnDefinitions="*,8,90,8,Auto">
<StackPanel Grid.Column="0" Spacing="2">
<TextBox Text="{Binding NewGrade}"
PlaceholderText="Note (z.B. 2 oder 11)" FontSize="12"/>
<TextBlock Text="{Binding NewGradeError}" Foreground="Red" FontSize="11"
IsVisible="{Binding NewGradeError, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
</StackPanel>
<StackPanel Grid.Column="2" Spacing="2">
<NumericUpDown Value="{Binding NewMinPercent}" Minimum="0" Maximum="100"
FormatString="0.##" ShowButtonSpinner="False" FontSize="12"
ToolTip.Tip="Mindest-Prozentgrenze"/>
<TextBlock Text="{Binding NewMinPercentError}" Foreground="Red" FontSize="11"
IsVisible="{Binding NewMinPercentError, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
</StackPanel>
<Button Grid.Column="4" Content="" Command="{Binding AddEntryCommand}"/>
</Grid>
</StackPanel>
<Button Grid.Row="1" Content="Fertig" HorizontalAlignment="Stretch" Margin="0,20,0,0" Click="OnClose"/>
</Grid>
</Window>