C# WPF倾斜标签项
我正在修改C# WPF倾斜标签项,c#,wpf-controls,msdn,tabitem,C#,Wpf Controls,Msdn,Tabitem,我正在修改选项卡项的标题,以便有条件地显示图像,这使我找到了这篇MSDN文章:。我尝试了代码并在我的条件映像中进行了替换,这符合我的预期 但是,该示例中的图像显示的TabItems的样式与我运行示例时得到的样式不同。在MSDN示例中,我在哪里可以获得倾斜的选项卡items的样式 您是否也应用了示例中的HeaderedContentControl的样式 <Style TargetType="HeaderedContentControl"> <Setter Property="
选项卡项
的标题
,以便有条件地显示图像
,这使我找到了这篇MSDN文章:。我尝试了代码并在我的条件映像中进行了替换,这符合我的预期
但是,该示例中的图像显示的TabItem
s的样式与我运行示例时得到的样式不同。在MSDN示例中,我在哪里可以获得倾斜的选项卡item
s的样式
您是否也应用了示例中的
HeaderedContentControl
的样式
<Style TargetType="HeaderedContentControl">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type HeaderedContentControl}">
<StackPanel>
<Grid>
<Rectangle Stroke="{TemplateBinding Background}"/>
<ContentPresenter ContentSource="Header"/>
</Grid>
<Grid>
<Rectangle Fill="{TemplateBinding Background}"/>
<ContentPresenter ContentSource="Content"/>
</Grid>
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
这将覆盖控件的默认
ControlTemplate
。此外,如果使用TabControl
而不是HeaderedContentControl
,则结果可能会有所不同。页面上的第二个示例看起来与TabItem
示例无关。