Search code examples
c#windows-phone-8resourceswinrt-xaml

Windows Phone ResourceLoader loads empty strings


I develop a Windows Phone 8.1 application and I need to put my string resources into separate assembly. I created a PCL project named "Resources" and put my localized string into files /Strings/Resources.lang-en-US.resw (for US culture), /Strings/Resources.lang-ru-RU.resw (for RU culture), /Strings/Resources.resw (for culture independent string resources). Unfortunately following code returns an empty string:

var resourceLoader = ResourceLoader.GetForCurrentView("Resources");
return resourceLoader.GetString("some_key");

I also cannot access resources in xaml by using x:Uid attribute. Can anybody help me? Thanks in advance.


Solution

  • I've figured. It was a mistake in resource map parameter in GetForCurrentView method. It should be "Resources/Resources", where the 1st Resources is the asssembly name while the 2nd stands for first part of resorce file names.