pfinferno
pfinferno

Reputation: 1945

Corner radius of border cut off by child grid

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

Upvotes: 0

Views: 126

Answers (0)

Related Questions