0

I have a window which has it's WindowStyle="None". I want to make the Border inside it have rounded corners. However, only the bottom right shows a rounded corner while the rest seem to be cut off by the content within the border. For example:

<Window
    x:Class="SampleApp.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    AllowsTransparency="True"
    Background="Transparent"
    WindowStyle="None"
    mc:Ignorable="d">
    <WindowChrome.WindowChrome>
        <WindowChrome CaptionHeight="0" ResizeBorderThickness="5" />
    </WindowChrome.WindowChrome>
    <Border
        x:Name="WindowBorder"
        Background="{DynamicResource WindowBackgroundColor}"
        BorderBrush="Black"
        BorderThickness="1"
        CornerRadius="10">
        <Grid>
            <!-- Main Content -->
        </Grid>
    </Border>
</Window>

On the bottom right corner, it looks fine like this: enter image description here

The other corners are cut off like: enter image description here enter image description here

pfinferno
  • 1,779
  • 3
  • 34
  • 62
  • 1
    Try setting `Padding` of your outer border to the same value as `CornerRadius` (but setting it to 5 or even 3 seems to work as well with `CornerRadius` of 10, at least in my test app). That will prevent overlaping of the contents within the grid with your rounded corners and ensure that this interaction will not cause unexpected behaviours – Legkov Ivan Aug 21 '23 at 06:46
  • 1
    Also if padding is not an option, consider the following [related SO answers](https://stackoverflow.com/a/28344788/17747737) – Legkov Ivan Aug 21 '23 at 06:58

0 Answers0