locked
Localizing Windows Phone 8.1 library from application

    Question

  • I have a library project, where resides my XAML pages or part of the user interface. This library is referenced by one or more application, where I want to place all styling and localization, including those for the referenced library. Where it is a question of resource dictionaries, it works like a charm - the library dynamically use the styles on the XAML pages from the application, but when I tried the same for the .resw files it doesn't work. If I put localization strings in the library it works, but I want to separate them from the library and define them in the particular application that would use the library. The language is C#, if that matters somehow.

    My investigation has shown that the problem could be solved if in the InitializeComponent() of pages, when LoadComponent is onvoked a parameter named componentResourceLocation is changed from "Nested" (which is generated for the pages in the Library) to "Application". That solves the problem generally. The remaining question is how to change this parameter in the method, because it is placed in the automatically generated part of the code, which is not OK to modify.

    Friday, November 14, 2014 12:50 PM

Answers