【发布时间】:2015-06-10 16:42:47
【问题描述】:
我正在尝试本地化我的 WP 8.1 应用程序。
这里是Strings/en-us/Resources.resw的一部分:
<data name="SampleProperty.Text" xml:space="preserve">
<value>Sample text</value>
</data>
<data name="SampleProperty.SomeRandomKey" xml:space="preserve">
<value>SAMPLE TEXT</value>
</data>
还有一个应用程序页面包含以下代码:
<TextBlock x:Uid="SampleProperty" />
但应用在导航到该页面的过程中抛出异常:
WinRT information: Unable to resolve property '%1' while processing properties for Uid '%0'. [Line: 167 Position: 24]
Additional information: The text associated with this error code could not be found.
如果我从资源字典中删除SampleProperty.SomeRandomKey,那么一切正常。但是这个字符串在我的应用程序的另一部分中使用。
问题可能出在哪里?
UPD
我在the documentation 的示例中添加了类似的属性:
<data name="SampleProperty.Text" xml:space="preserve">
<value>Sample text</value>
</data>
<data name="SampleProperty.Width" xml:space="preserve">
<value>0</value>
</data>
一切正常。 但我不明白为什么这行得通,为什么第一种情况会出现异常......
【问题讨论】:
标签: c# windows-runtime windows-store-apps windows-phone-8.1 windows-8.1