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

BoxShadow will not take effect when Border has only one side #11517

Open Mochengvia opened 1 year ago

Mochengvia commented 1 year ago
<Border Height="35" Width="100" Background="White"
        BorderBrush="Gray" BorderThickness="0,0,0,1" BoxShadow="5 5 10 2 Red"/>

图片

Mochengvia commented 1 year ago

It effective when BorderThickness = 0 or BorderThickness = 1, why

rabbitism commented 1 year ago

non uniform border is not well supported. Please also check below issue. This is unlikely to be fixed in v 11.0

https://github.com/AvaloniaUI/Avalonia/issues/11490

Mochengvia commented 1 year ago

Alright, thanks for your reply. I'll skip this problem for now.

Flithor commented 1 year ago

Workaround: Just use 2 Border

<Border Width="100" Height="35"
        Background="Blue"
        BoxShadow="5 5 10 2 Red">
    <Border BorderBrush="White" BorderThickness="0,0,0,5" />
</Border>

image