检查Window标签是否包含以下属性
WindowStyle="None"
AllowsTransparency="True"
Background="{x:Null}"
可对比下面代码找出问题
<Window x:Class="WpfApplication30.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" WindowStyle="None" AllowsTransparency="True" Background="{x:Null}"> <Grid> <Border CornerRadius="10" > <Border.Background> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="Black" Offset="0"/> <GradientStop Color="#FFF31515" Offset="1"/> </LinearGradientBrush> </Border.Background> </Border> </Grid> </Window>
AllowsTransparency="True",这个属性设上就可以了,
WindowStyle="None" AllowsTransparency="True"
看来这两个要搭配用才行