我有一个 TextBlock 和一个 Rectangle,它们都位于一个空的 WPF4 窗口中。TextBlock 的 Foreground 和 Rectangle 的 Fill 都设置为 SolidColorBrush,值为 #80800000。
这是它的样子:
Rectangle 的颜色是正确的(50% 透明栗色),但 TextBlock 给出的是纯灰色。这是怎么回事?
编辑:这是 XAML:
<Window x:Class="WpfApplication1.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">
<Grid>
<TextBlock Foreground="#80800000" Height="100" HorizontalAlignment="Left" Margin="47,39,0,0" Text="TextBlock" VerticalAlignment="Top" Width="266" FontFamily="Arial" FontWeight="Bold" FontSize="56" />
<Rectangle Fill="#80800000" Height="100" HorizontalAlignment="Left" Margin="71,174,0,0" Stroke="{x:Null}" VerticalAlignment="Top" Width="200" />
</Grid>
</Window>