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>
精彩评论