User avatar
ARPP3
Topic Author
Posts: 26
Joined: 20 Jun 2023, 21:22

Is there an equivalent to the SetResourceReference method?

03 Mar 2025, 09:02

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,
 
User avatar
sfernandez
Site Admin
Posts: 3363
Joined: 22 Dec 2011, 19:20

Re: Is there an equivalent to the SetResourceReference method?

03 Mar 2025, 21:17

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?
 
User avatar
ARPP3
Topic Author
Posts: 26
Joined: 20 Jun 2023, 21:22

Re: Is there an equivalent to the SetResourceReference method?

04 Mar 2025, 11:30

Sure, I will do :) Thanks for the quick response!

Who is online

Users browsing this forum: Google [Bot] and 3 guests