Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Using external resource files

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Globalizer Support
View previous topic :: View next topic  
Author Message
kevinkuebler



Joined: 19 Jan 2015
Posts: 20
Location: United States

PostPosted: Mon Jan 19, 2015 5:14 pm    Post subject: Using external resource files Reply with quote

Hi,

I'm evaluating the use of Globalizer and the Resx extension in our WPF application. I know that the recommendation is to have one resx file per window/user control, and I have read the thread here regarding the use of common resource files.

However, there are reasons I would like to explore the use of shared resource files. And even going a step further, I would like to put them in a separate project/assembly from the main UI project. I've done this before with success when using the standard {x:Static loc:MyResources.MyKey} technique in XAML, where "loc" is an xmlns which references the namespace in the assembly containing the resources.

Is it possible to do this same sort of thing using the Resx extension? So far I have not been able to find a way to make it work, neither by using the DefaultResxName property at the window level, nor by adding ResxName directly to the controls using the Resx extension.

Thanks,
Kevin Kuebler
Back to top
View user's profile Send private message
kevinkuebler



Joined: 19 Jan 2015
Posts: 20
Location: United States

PostPosted: Mon Jan 19, 2015 8:20 pm    Post subject: Reply with quote

I figured it out by looking at the source. The markup extension searches through the assemblies returned from:
Code:
AppDomain.CurrentDomain.GetAssemblies()
However, the assembly containing my resources wasn't in that list, even though I reference it from the UI project. By simply accessing one of the resource properties in that assembly in my app's startup code, it forces the assembly to be loaded into the AppDomain before the first usage of the extension, and then it works.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Mon Jan 19, 2015 9:47 pm    Post subject: Reply with quote

Great - thanks for letting us know you found a solution.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Globalizer Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group