I use markupextension to load internationalized strings in a WPF application as follows:
<Button Content="{Translate MyText}"/>
My markupextension is called "TranslateExtension", and it searches for the value for the "MyText" key from the database. He does it in
ProvideValue(IServiceProvider serviceProvider)
which returns the correct string. Everything is working fine.
My problem is that the ProvideValue method no longer calls, and there is no way to fetch a new row from the database when the language changes. Now I need a way to make the return value βdynamicβ in order to get Button to reload its xaml and reuse the markup extension, whether it will be through an event created when a language change or something else. How to call the ProvideValue method system call again? I tried similar InvalidateVisual () InvalidateArrange () InvalidateMeasure () UpdateLayout () ...
I hope I get it. Please feel free to ask more about what you think you can provide ideas or solutions. Thanks you
markup wpf xaml dynamicresource
JanLookingForClues
source share