0
是否可以使用resjson格式而不是resw for xaml/c#store apps?.resjson in C#XAML store app
在我的情况下,我有大的json文件已被翻译。我发现json格式更容易处理,所以我宁愿使用json文件而不是resw。我知道多语言工具包的工作原理,但是现在我在使用带有x:Uid的resjson格式或直接使用资源加载器时会得到空字符串。
var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
string text = loader.GetText("HelloWorld/Text");
文本以空字符串出现。
不过,我能够通过这个看到字符串:
var map = ResourceManager.Current.MainResourceMap.GetSubtree("/resources");
var list = map.Keys.ToList();
string val = map.GetValue("Greeting.Text").ValueAsString;