我的 Win10 UAP 中有按钮样式。该样式有工具提示。
如何在 resx 字符串资源中制作此样式引用文本?
<Style x:Key="MyButtonStyle" TargetType="Button" >
...
<Setter Property="ToolTipService.ToolTip" Value="<string in resx resources>" />
</Style>
最佳答案
您好,在 UWP 中,最好使用 .resw 而不是 .resx。以下是使用 .resw 资源的方法:
<Style x:Key="CustomButtonStyle" TargetType="Button">
<Setter Property="ToolTipService.ToolTip">
<Setter.Value>
<TextBlock x:Uid="CustomText" />
</Setter.Value>
</Setter>
</Style>
我的 .resw 文件如下所示: 名称 -> CustomText.Text
值 -> 这是自定义文本
关于winrt-xaml - XAML 样式的 resx 资源的引用字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38256729/