Is there an equivalent to the SetResourceReference method?
Good morning!
I was wondering if there's any equivalent to this SetResourceReference function: https://learn.microsoft.com/en-us/dotne ... ereference
Currently In XAML I reference some localized strings simply by using the DynamicResource markup extension. This works well for most but, in some cases I need to dynamically create elements from code. An example recently is, a popup window. I have a localization manager class which I've written and, it can translate the strings in code using the resource dictionary, but if I swap languages at runtime then somehow I'd have to change these. If I was able to set the resource reference for the text property on a text block, I think this would be the simplest solution. I couldn't see if this function exists though? Or some noesis extension which might do something similar?
If not, I might try to rework my popup windows to use bindings rather than directly-set strings, and those bindings being to properties which call the localization function + a refresh function which is called when languages change to mark notify they've changed. I was just curious before going this route, if SetResourceReference has an equivalent implementation in Noesis :)
Thanks!
David,
I was wondering if there's any equivalent to this SetResourceReference function: https://learn.microsoft.com/en-us/dotne ... ereference
Currently In XAML I reference some localized strings simply by using the DynamicResource markup extension. This works well for most but, in some cases I need to dynamically create elements from code. An example recently is, a popup window. I have a localization manager class which I've written and, it can translate the strings in code using the resource dictionary, but if I swap languages at runtime then somehow I'd have to change these. If I was able to set the resource reference for the text property on a text block, I think this would be the simplest solution. I couldn't see if this function exists though? Or some noesis extension which might do something similar?
If not, I might try to rework my popup windows to use bindings rather than directly-set strings, and those bindings being to properties which call the localization function + a refresh function which is called when languages change to mark notify they've changed. I was just curious before going this route, if SetResourceReference has an equivalent implementation in Noesis :)
Thanks!
David,
-
-
sfernandez
Site Admin
- Posts: 3363
- Joined:
Re: Is there an equivalent to the SetResourceReference method?
Unfortunately there is no alternative in C# for that method. Could you please report it in our bugtracker and we will include it in the next version?
Re: Is there an equivalent to the SetResourceReference method?
Sure, I will do :) Thanks for the quick response!
Who is online
Users browsing this forum: Google [Bot] and 3 guests