问题描述
限时送ChatGPT账号..我正在为应用程序中的某些 TabControl 创建特定样式.
I'm creating a specific style for some TabControl in my application.
<TabControl Style="{StaticResource MyTabControl}">
</TabControl>
对于这个特定的 TabControl 的样式,我还想设置 TabItem 的样式.
I want to also style TabItem in the case of this specific TabControl's Style.
现在,我必须写:
<TabControl Style="{StaticResource MyTabControl}">
<TabItem Style="{StaticResource MyTabItem}" Header="First" />
<TabItem Style="{StaticResource MyTabItem}" Header="Second" />
</TabControl>
不必在每个 TabItem 上指定MyTabItem"样式,有没有什么方法可以仅在特定 TabControl 样式的范围内设置默认 TabItem 样式?
Instead of having to specify the "MyTabItem" style on each TabItem, is there any way to set the default TabItem style only in the scope of a specific TabControl Style ?
我没有找到一种方法来在我的 TabControl 的样式中指定应将哪种样式应用于所有子 TabItem.
I didn't found a way to specify, in the style of my TabControl, which style should be applied on all children TabItems.
推荐答案
<TabControl ItemContainerStyle="{StaticResource MyTabItem}"/>
这篇关于如何在tabcontrol的样式中设置tabitem的默认样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论