窗口 10 - 来自 XAML 样式的 resx 资源的引用字符串



我的 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 文件看起来像:名称 -> 自定义文本.文本

值 -> 这是自定义文本

最新更新