我找到了这个:
更新更多代码:
在RibbonMenuButton控件上按下“编辑模板”按钮后,在Blend中创建了此代码。
<DataTrigger Value="True" Binding="{Binding (0)}">
RibbonMenuButton
模板中的触发器是什么意思?我尝试过谷歌搜索,但没有找到任何结果。更新更多代码:
<ControlTemplate x:Key="RibbonMenuButtonControlTemplate1" TargetType="{x:Type RibbonMenuButton}">
...
<DataTrigger Binding="{Binding (0)}" Value="True">
<Setter Property="TextElement.Foreground" TargetName="MainGrid" Value="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}"/>
<Setter Property="PathFill" TargetName="TwoLineText" Value="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}"/>
<Setter Property="CornerRadius" TargetName="OuterBorder" Value="0"/>
<Setter Property="Background" TargetName="OuterBorder" Value="Transparent"/>
<Setter Property="BorderBrush" TargetName="OuterBorder" Value="Transparent"/>
</DataTrigger>
...
在RibbonMenuButton控件上按下“编辑模板”按钮后,在Blend中创建了此代码。
StringFormat
吗?能否发布一下参考文献? - Rohit Vats