I'm developing an UWP app which will be side loaded and get's most of its config from an WebAPI. I want to be able to use translated labels both in XAML and Code, as I see the "UWP way" is to use resource files, but I don't want to store the string in the project itself, I want them to load from the WebAPI and then use the cached key-value distionary.
Obviously no problem to get the strings in code, problem is with XAML - in WPF it was pretty simple with a custom MarkupExtension, but because we don't have MakrupExtensions in UWP, is there a clean way to do so?
EDIT:
What I tried so far:
- create base class for all controls with an object that has an indexer to get a translations - not working because x:Bind doesn't support string based indexers
- trying to use custom dynamic object - not working because x:Bind doesn't support dynamic objects
- trying to ass some own class as a resource and access properties from it - again not working
For now the only way seems to create a huge class where each translation/label will have to have it's own property, or to use standard Binding (or some class derived from it).
EDIT_2:
Forgot, that another use case would be to use it in xaml resources with templates, not only controls and pages.