I override borders CornerRadius as a default style in the app.xaml file (like below)
<Application x:Class="BorderCornerProblem.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="CornerRadius" Value="50"/>
</Style>
</Application.Resources>
</Application>
and in the MainWindow.xaml file I have
<Window x:Class="BorderCornerProblem.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
</Window>
the result is that the window has a black rounded corners.
My question then is how to define a DefaultStyle with CornerRadius set for Border that will not mess with my Window?
You really should not globally style
Borders, they are everywhere.Give the style a key and only reference it where needed.