我有一个特定的按钮内容,其中 Tx 是一个 UTExtension,用于通过按键获取字符串。如何将字符串转换为大写。
<Button
Style="{StaticResource ButtonHomePageLeft}"
Content="{Tx:UT Key=Tx:homepage.button.info}"/>
我尝试了这种方式,但它抛出异常
<Button
Style="{StaticResource ButtonHomePageLeft}"
Content="{Bindin Path={Tx:UT Key=Tx:homepage.button.info},
Converter={StaticResource ToUpperCaseConverter}}"/>
抱歉,我的问题不够具体。即使我以这种方式使用代码,我也会遇到异常。
<Button
Style="{StaticResource ButtonHomePageRight}">
<Button.Content>
<Binding>
<Binding.Path>
<Tx:UT Key="Tx:homepage.button.use"/>
</Binding.Path>
</Binding>
</Button.Content>
</Button>
最佳答案
您可以尝试 Button 的 Typography.Capitals 属性:
<Button Typography.Capitals="AllSmallCaps"></Button>
关于c# - 将按钮内容设置为大写,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36175077/