开发者

Set TabItem header as TextBlock in XAML

Right now I have something like this:

<TabItem Name="tbActive" Width="100" Height="100"  Header="Current" >
开发者_如何学运维

and in the code behind I set the Header -- so setting it above is a bit pointless

TextBlock tb = new TextBlock();
tb.Text = "Current";
tb.MouseDown += new MouseButtonEventHandler(tb_MouseDown);
tbActive.Header = tb;

I don't want to use this code behind... I'd rather it all be XAML. So how can I set the 4 textblock lines in my TabItem XAML ?


<TabItem Name="tbActive" Width="100" Height="100">
    <TabItem.Header>
         <TextBlock Text="Current"
                    MouseDown="tb_MouseDown"/>
    </TabItem.Header>
</TabItem>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜