我正在以编程方式为WPF窗口中的元素创建弹出窗口,但无法去除黑色边框:
用户控件
var p = new Popup {
PlacementTarget = target,
IsOpen = true,
StaysOpen = false,
AllowsTransparency = true
};
// Add the popup content
p.Child = new Views.MapLocationInformation {DataContext = context};
用户控件
MapLocationInformation
在XAML中定义为以下形式:<UserControl ...
mc:Ignorable="d"
Background="Transparent"
d:DesignHeight="65" d:DesignWidth="401">
<Border BorderThickness="1"
CornerRadius="5"
BorderBrush="{StaticResource ExpanderHeaderBorderGradient}"
Background="White"
Margin="0 0 8 8">
<Stackpanel> ... </Stackpanel>
</Border>
</UserControl>
我找不到任何边框、背景填充和透明度设置的组合,可以将黑色区域设为透明。有什么想法吗?