2016-07-07 47 views
2

我的Win10 UAP中有按鈕風格。該風格有工具提示。XAML風格的resx資源引用字符串

如何在resx字符串資源中創建此樣式引用文本?

<Style x:Key="MyButtonStyle" TargetType="Button" > 
     ... 
     <Setter Property="ToolTipService.ToolTip" Value="<string in resx resources>" /> 

    </Style> 

回答

1

你好在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

價值 - >這是自定義文本