【发布时间】:2009-04-07 15:59:37
【问题描述】:
我的 App.xaml 中有一个全局字符串,我想在 UserControl xaml 中使用如何引用它?
<Application.Resources>
<sys:String x:Key="Assembly">Zpg</sys:String>
</Application.Resources>
我在 UserControl 资源中也有一个变量,我是否可以在 xaml 中以类似的方式使用它?
<UserControl.Resources>
<sys:String x:Key="Dictionary">Test</sys:String>
</UserControl.Resources>
我希望这是有道理的,基本上我有以下我想参考上面的变量来替换,因为我会经常使用它们。
Text="{LocText Key=MyString, Dict=Test, Assembly=Zpg}"
谢谢,
詹姆斯
【问题讨论】: