CalendarDatePicker: DateTimeOffset<->DateTime-Konvertierung per Converter
CI / build-and-test (push) Canceled after 0s
CI / build-and-test (push) Canceled after 0s
CalendarDatePicker.SelectedDate ist (WPF-Toolkit-Ursprung) DateTime?, nicht DateTimeOffset? wie beim eingebauten DatePicker - Avalonia bietet dafuer keine automatische Konvertierung. Ohne Converter blieb das Feld leer und ein Klick auf einen Kalendertag warf eine InvalidCastException. Betraf auch die schon bestehenden Bindings in WithdrawStudentDialog und CreateLetterDialog, nur bislang unbemerkt. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<Window xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="clr-namespace:LehrerApp.Desktop.ViewModels.Groups"
|
||||
xmlns:conv="clr-namespace:LehrerApp.Desktop.Converters"
|
||||
x:Class="LehrerApp.Desktop.Views.Groups.WithdrawStudentDialog"
|
||||
x:DataType="vm:WithdrawStudentDialogViewModel"
|
||||
Title="Schüler austragen"
|
||||
@@ -23,8 +24,8 @@
|
||||
|
||||
<StackPanel Spacing="5">
|
||||
<TextBlock Text="Austrittsdatum" FontSize="12" Opacity="0.7"/>
|
||||
<CalendarDatePicker SelectedDate="{Binding SelectedDate}"
|
||||
DisplayDateStart="{Binding EarliestDate}"
|
||||
<CalendarDatePicker SelectedDate="{Binding SelectedDate, Converter={x:Static conv:DateTimeOffsetToDateTimeConverter.Instance}}"
|
||||
DisplayDateStart="{Binding EarliestDate, Converter={x:Static conv:DateTimeOffsetToDateTimeConverter.Instance}}"
|
||||
HorizontalAlignment="Stretch"/>
|
||||
<TextBlock Text="{Binding DateError}" Foreground="Red" FontSize="12"
|
||||
IsVisible="{Binding DateError, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
||||
|
||||
Reference in New Issue
Block a user