AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
https://avaloniaui.net
MIT License
26.1k stars 2.26k forks source link

Missing CornerRadius on Expander #10538

Open robloo opened 1 year ago

robloo commented 1 year ago

Describe the bug

Expander is missing corner radius

To Reproduce

View the Expander page in ControlCatalog

Expected behavior

Should have default 4px corner radius like other controls.

Screenshots

image

Desktop (please complete the following information):

Additional context

Likely related to the style system changes with theme variant or something. This might be the best example of the issue I've seen where existing resources are not found. Or... it could be a simple bug with the control theme or resource definitions. I haven't dug into anything yet and am only filing the issue.

robloo commented 12 months ago

Note the change in behavior relates to AvaloniaProperty.UnsetValue here:

https://github.com/AvaloniaUI/Avalonia/blob/3725f0dc805adda52fe08ff0c765a397b2d9b20d/samples/ControlCatalog/ViewModels/ExpanderPageViewModel.cs#L8

The view model will default to UnsetValue. In the past the property/binding system would see this, ignore it, and then continue to apply the "base" style even though it is bound. The base is the ControlCornerRadius in the case of Fluent theme.

Somewhere in Avalonia v11 development behavior changes and UnsetValue in this case will still override any default and just set an empty value.