locked
Accessing Resources.resw RRS feed

  • Question

  • I added a Resources.resw to my Windows 8 RT class library, then added some lines containing Name, Value, and Comment.

    My expectation is that from other classes in the project, I could just say Resource.MyName, and it would return the Value for MyName as defined in the Resources.resw.

    I'm don't see how to access the strings I've defined from other classes in the project, and I cannot find an example by surfing. Resource.MyName does not compile.

    Can anyone point me to a link describing how to easily use string resources in a Windows 8 RT project? This should be trivial...


    Randy

    Monday, November 4, 2013 7:44 PM

Answers

All replies

  • In the bar at the top of the screen select How to/Developing apps (C#/C++/VB)/Globalizing your app
    Monday, November 4, 2013 7:49 PM
    Moderator
  • Even though this is answered, it's nice to have a code example to avoid having to dig through the links:

    var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
    var string = loader.GetString('Farewell');
    
    


    Randy

    Tuesday, November 12, 2013 3:44 PM