WPF窗口未正确显示透明度
我的窗户很难透明 窗口定义如下:WPF窗口未正确显示透明度,wpf,xaml,user-interface,window,Wpf,Xaml,User Interface,Window,我的窗户很难透明 窗口定义如下: <Window x:Class="HKC.Desktop.Views.UserInterfaces.RemoteKeypad" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Closing="Window_Close
<Window x:Class="HKC.Desktop.Views.UserInterfaces.RemoteKeypad"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Closing="Window_Close"
KeyDown="RemoteKeypad_KeyDown"
KeyUp="RemoteKeypad_KeyUp" MouseDown="OnMouseDown_Event"
Title="Title" Width="325" Height="370"
ResizeMode="NoResize" WindowStartupLocation="CenterScreen" WindowStyle="None" AllowsTransparency="True" Background="Transparent">
然后,我定义了一个边界,为窗口提供了一个弯曲的边缘,内部有一个网格用于布局:
<Border CornerRadius="20" Background="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Border.Effect>
<DropShadowEffect BlurRadius="6" ShadowDepth="3" Color="#484948" />
</Border.Effect>
<Grid Background="Transparent" VerticalAlignment="Stretch">
....
</Grid>
</Border>
</Window>
由于某种原因,我第一次打开窗口时背景是不透明的
但是,如果我离开窗口单击,返回窗口,透明度将按预期工作。结果表明,问题在于用于向元素添加阴影的外部工具。是否使用windows xp?