0

I have a WPF application that fetches resources at runtime through apis. I need to save those labels locally in .txt file and read from them as saving in .resx file requires re-compilation that is not possible at runtime. Please suggest how to read resources from the file to UI and messages.

Thanks

  • You want to save the labels in a text file and then read them again?? – richej May 28 '18 at 12:55
  • What have you tried? It's a site for helping in technical issues, not for teaching how to do general tasks. – Maciek Świszczowski May 28 '18 at 13:11
  • @MaciekŚ. I have tried the general resource manager approach , creating a resource file at runtime and reading from it, but as my question states, this does not reflect at runtime as the project needs recompilation since these resx files are embedded resource. – Varsha Khanna May 29 '18 at 05:45
  • @richej, Yes, I am able to read those labels to messages in my classes but how to bind those labels to wpf UI controls ? I dont want to bind each and every control's text/content property to the viewmodel – Varsha Khanna May 29 '18 at 05:47
  • I'd experiment with a DynamicResource then (https://learn.microsoft.com/en-us/dotnet/framework/wpf/advanced/dynamicresource-markup-extension). A key would be exposed through a property in a static class (https://stackoverflow.com/a/3862828/275330). – Maciek Świszczowski May 29 '18 at 10:04

1 Answers1

0

Its possible you can get help from this link ms link

After trying if you fail then post your code.

I hope this link will helpful to you. But this site is for solving errors not for teaching.

Try yourself if you fail then post your code where you are getting error.

Abhi verma
  • 303
  • 2
  • 7