WPF Border Container with Corner Smoothing (Figma style Corner Smoothing using Squircle)
You should install WPF.CornerSmoothing with NuGet:
Install-Package WPF.CornerSmoothing
Or via the .NET Core command line interface:
dotnet add package WPF.CornerSmoothing
Either commands, from Package Manager Console or .NET Core CLI, will download and install WPF.CornerSmoothing and all required dependencies.
To use add namespace to your control:
xmlns:cs="clr-namespace:WPF.CornerSmoothing;assembly=WPF.CornerSmoothing"
Then use SmoothBorder
control:
<cs:SmoothBorder Width="200"
Height="200"
Padding="15"
CornerRadius="50"
CornerSmoothing="1"
ClipContent="True"
BorderBrush="#7F000000"
BorderThickness="10"
Background="#FFFD74C8"
>
<Rectangle Fill="#FF9093FF" />
</cs:SmoothBorder>
Where:
CornerSmoothing
(value from0
to1
)0.1=10%
,1=100%
Figma's Corner smoothing,0
is equals standart Border CornersClipContent
(booleanTrue
/False
) Enable Content Clip to to have corners same as container with Padding and BorderThickness adjustements
Check Examples in the Demo project.