locked
Add values to .resw file programmatically ?

    Question

  • The project which I have been developing need to load names and values in resw file dynamically. It is possible in winforms and asp.net but in windows 8.1 there is no ResXResourceWriter to make changes in resw file, so the question is how to add values programmatically in .resw file?
    Thursday, September 4, 2014 6:56 AM

Answers

All replies

  • What is the goal? Why do you want to edit it programmatically?

    The resw file is xml so you can edit it with any xml API if you want to add translations programmatically.

    It is a source file and is not included in the appx package, so you cannot edit it at runtime. Even if it were in the appx package, the app doesn't have write access to its installation.

    --Rob

    Thursday, September 4, 2014 7:15 AM
    Owner
  • Actually it is project requirement that the name of buttons and text in textblocks will come from server when I make request and according to user the culture will set.
    Thursday, September 4, 2014 7:38 AM
  • you cant exytend the resw; they are part of the package. You will need to build something yourself and store it in xml / json

    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Thursday, September 4, 2014 11:18 AM
  • Can you give me a weblink or an example scenario from where  I can start my work.

    • Edited by Vinay Jade Thursday, September 4, 2014 12:18 PM
    Thursday, September 4, 2014 12:17 PM
  • If you want the data to come from the server at runtime then you'll be outside of the resource system. Instead you can load the data into your own structures and bind the text strings to the updated data.

    See

    Data binding with XAML

    QuickStart: data binding to controls

    XAML data binding sample

    Thursday, September 4, 2014 5:59 PM
    Owner