【发布时间】:2011-04-23 21:12:02
【问题描述】:
我正在使用 WPF Popup 控件,它的背景显示为黑色。我在其中放了一个 StackPanel,背景为“透明”,但这无济于事。
<Popup PlacementTarget="{Binding ElementName=parentStackPanel}" Placement="Center"
IsOpen="False" Name="m_popWaitNotifier" PopupAnimation="None"
AllowsTransparency="False">
<StackPanel Orientation="Vertical" Background="Transparent">
<uc:CircularProgressBar x:Name="CB" StartupDelay="0"
RotationsPerMinute="20"
Height="25" Foreground="White"
Margin="12"/>
</StackPanel>
</Popup>
如何使 Popup 上的背景透明(或任何颜色)?
【问题讨论】:
-
请发布一些示例 XAML。您所描述的不是默认行为,但是如果不知道您如何定义它,就很难说得更多。
-
@PN 顺便说一句——如果您添加代码,请选择(突出显示)它,然后选择编辑文本框上方的“代码”按钮。这将格式化代码,使其更具可读性。
-
如果将 CircularProgressBar 控件直接添加到窗口(作为测试)会发生什么。黑色背景可能来自那里吗?
标签: wpf user-interface popup