So I have a border with a CornerRadius
and I added a Polyline
to it, hoping that it would clip where the CornerRadius
is, but it doesn't. As you can see in the image it overflows and I want it to clip if it reaches where the CornerRadius
starts.
<Border Width="320"
Height="368"
CornerRadius="10"
Background="#1D1A27"
Margin="50,0,0,0">
<Polyline Points="0,0 320,0 0, 80"
Fill="AliceBlue" />
</Border>
CodePudding user response:
Set the Border's Clip
to an appropriate RectangleGeometry:
<Border Width="320" Height="368" Background="#1D1A27" Margin="50,0,0,0">
<Border.Clip>
<RectangleGeometry RadiusX="10" RadiusY="10" Rect="0,0,320,368"/>
</Border.Clip>
<Polyline Points="0,0 320,0 0,80" Fill="AliceBlue" />
</Border>