Using the ResourceLoader.GetString Method to Retrieve Resources with Dots in a Key

I am using ResourceLoader.GetString to get string resources from my .resw file. I can get resources without a dot in the key, but those with a dot appear as an empty string. For instance:

var rl = new Windows.ApplicationModel.Resources.ResourceLoader(); rl.GetString("HelpText"); // gets the string "Help" rl.GetString("Forget.Text"); // gets "", even though it defined in resw file as "Forgotten" 

I tried replacing the dot with various other characters:

 rl.GetString("Forget_Text"); rl.GetString("Forget:Text"); rl.GetString("Forget-Text"); 

Bad luck. All MSDN examples skilfully avoid mentioning this little problem, so I'm a bit puzzled. Can anyone help?

+5
source share
1 answer

It is accessed using a slash:

 rl.GetString("Forget/Text"); 
+16
source

Source: https://habr.com/ru/post/1213342/


All Articles