我希望 TextBlock
、Label
、MenuItem.Header
中的所有文本都以大写显示。
字符串取自 ResourceDictionary
例如:
<TextBlock Text="{StaticResource String1}"/>
<MenuItem Header="{StaticResource MenuItemDoThisAndThat}"/>
等等。 (也适用于 Label
和其他控件)
我不能使用值转换器,因为没有绑定(bind)。我不想让字典本身中的字符串大写。
最佳答案
我认为这对你有用
<TextBlock Text='{StaticResource String1}' Typography.Capitals="AllPetiteCaps"/>
对于字体大写枚举 https://msdn.microsoft.com/en-us/library/system.windows.fontcapitals(v=vs.110).aspx
https://stackoverflow.com/questions/1762485/