Read Write resjson files RRS feed

  • Question

  • Hello everyone :)

    I want to access my resjson file and edit it,add,and get values from it but i don't know how to do that :/

    Any suggestions please? thanks :)

    Sunday, March 4, 2012 6:18 PM


  • Hi,

    You can directly open it, modify or add items via Visual Studio 11.

    In javascript code, you can get value like the following code snippet.

    var resourceLoader = new Windows.ApplicationModel.Resources.ResourceLoader();
    var resourceValue = resourceLoader.getString('<resource name in resjson file>');

    In HTML markup, you can bind it to control like this.

    <input type="text" title=" " data-win-res="{title: '<resource name in resjson file>'}"/>

    Your app should call WinJS.Resources.processAll() made after the DOMContentLoaded event, as it is critical to the document's UI displaying properly.

    Please refer to Quickstart: Loading user- and device-specific UI resources to learn more details.

    Here is an example Application resources and localization sample for your reference.

    Best wishes,

    Robin [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, March 5, 2012 2:48 AM