Closed alex6dj closed 1 year ago
It's a styling issue here...
https://github.com/amwx/FluentAvalonia/blob/172ab14f0c4ddb8b4025a9699e3ad35d174bb08a/FluentAvalonia/Styling/BasicControls/CalendarDatePickerStyles.axaml#L25-L122
I didn't add a separate DataValidationErrors
item as the root of the control template, instead template binded it to the TextBox. Theoretically that should work (and should be the way to do it) but for some reason it doesn't
EDIT: After looking into this more, it appears to be an issue with the actual control. I was able to repro with a very basic INotifyDataErrorInfo
test with both my theme and the stock Fluent theme - and also checked the template for what I previously said and could not get binding to trigger the error info. I'd suggest opening an issue on Avalonia about this. Interestingly errors do show up if you set the error in Xaml as an attached property, but seem to fail if binding.
Describe the bug According to this PR https://github.com/AvaloniaUI/Avalonia/pull/7308 validation with Avalonia is handled correctly when using CalendarDatePicker.SelectedDate property (didn't tested). Now Im using the last version of FluentAvalonia but I cant make it to work, not sure if it is an Avalonia or this library bug. The validation is running correctly against a TextBox but not against CalendarDatePicker, it didnt show any visual indication. Maybe Im missing something. If I set the same validation against a property binding to a textbox I can see the validation error. Maybe you can provide a workaround.
Screenshots Failed validation state. In the Textbox the error appears but the CalendarDatePicker dont show any date validation error.
Desktop/Platform (please complete the following information):
Additional context Code sample: