refactor: use DataTemplates instead of create NamedHighlightedTextBlock manually for menu item (#1216)

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-04-20 11:05:24 +08:00
parent 5fd074a9b6
commit 41416a6bed
No known key found for this signature in database
7 changed files with 69 additions and 68 deletions

View file

@ -838,7 +838,13 @@
ContentTemplate="{TemplateBinding HeaderTemplate}"
VerticalAlignment="Center"
HorizontalAlignment="Stretch"
RecognizesAccessKey="False"/>
RecognizesAccessKey="False">
<ContentPresenter.DataTemplates>
<DataTemplate DataType="x:String">
<v:NameHighlightedTextBlock Text="{Binding}" VerticalAlignment="Center"/>
</DataTemplate>
</ContentPresenter.DataTemplates>
</ContentPresenter>
<TextBlock x:Name="PART_InputGestureText"
Grid.Column="2"