Microsoft technologies are changing constantly and without pause. This is good for us (developers), it keeps us busy 🙂
Resources in .Net always were files with .resx extension and easily usable from code through static class that is not available in Windows Store Apps. Why? I don’t know.
In Windows Store Apps exists files with resw extension. In this file you can put string resources only, remember in resx you could put any kind of resources (files, string, audio, images)
Luckily, using in XAML is easier now. Look an example:
Errros : is the name of resw file. Unique in all solution. Complete path isn’t possible
AlreadyRegisteres : Is the string resource in resw file
In the other hand, using in code is more difficult or maybe less intuitive. Look an example:
var res = Windows.ApplicationModel.ResourceLoader('Errors'); res.GetString('AlreadyRegistered');
Loading strings from libraries, controls, or software development kits (SDKs).
However, loading resources from another library seems easier in Windows Store than old platforms. Oh my gosh, I said old? 🙂
ResourceLoader R = new Windows.ApplicationModel.Resources.ResourceLoader(“ContosoControl/Resources”);
R.getString(“loadingStr”); // which came from ContosoControl’s Resources.resw
ContosoControl : External library name
Resources : resw file name
loadingStr : string resource