设置UserControl的问题

时间:2013-06-19 17:56:42

标签: wpf xaml user-controls

我创建了一个UserControl,它只是一个可关闭的tabItem(在代码中继承了TabItem)并且无法弄清楚如何以正确的方式设置它

 <UserControl x:Class="CloseableHeader"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" Margin="0" d:Height="32" d:Width="112" >
    <Grid>
        <Button  Height="21" HorizontalAlignment="Right" Name="button_close" VerticalAlignment="Top" Width="24" FontFamily="Courier" FontWeight="Bold" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" FontStretch="Normal" Visibility="Visible" FontSize="14" Padding="0" ToolTip="Close" Margin="0,5,5,0">
            <Image Height="19" Width="20" RenderTransformOrigin="0.45,0.5" Source="close.png"/>

        </Button>
        <Label Content="TabItem"  Height="28" HorizontalAlignment="Left" Margin="4,2,0,0" Name="label_TabTitle" VerticalAlignment="Top" FontFamily="Verdana" FontSize="14.667" Foreground="#FD000000" />
    </Grid>
</UserControl>

enter image description here 请告诉我为什么背景仍然是白色的?它应该是透明的。

0 个答案:

没有答案