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 

ResoureDictionary with localizable resources

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



Joined: 25 Jan 2011
Posts: 21

PostPosted: Tue Aug 07, 2012 2:19 pm    Post subject: ResoureDictionary with localizable resources Reply with quote

Hi,

I have a ResourceDictionary with lots of DataTemplates in it. Those DataTemplates have TextBoxes, Grid Headers etc. I want to localize.

When scan this ResourceDictionary xaml file Globalizer puts a

Code:

ResxExtension.DefaultResxName="SonicTC.View.Component.Views.DeviceDataTemplates"


inside the top level ResourceDictionary definition.

Unfortunately this leads to an exception later while loading this file because:

Code:
Object of type 'System.Windows.ResourceDictionary' cannot be converted to type 'System.Windows.DependencyObject'.


Probably because the attached property ResxExtension.DefaultResxName cannot be applied to a ResourceDictionary.

Can i suppress the generation of ResxExtension.DefaultResxName or is there another workaround (except to exclude this file which i don't want)?
Back to top
View user's profile Send private message
gunters63



Joined: 25 Jan 2011
Posts: 21

PostPosted: Tue Aug 07, 2012 2:26 pm    Post subject: Reply with quote

I found the option unter "Set default ResxName".

I had to revert the changes Globalizer made, uncheck this option and scan again.

Setting the default ResxName with an attached property will always fail on ResourceDictionaries. Probably Globalizer can ignore the setting in this case.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Thu Aug 09, 2012 12:48 am    Post subject: Reply with quote

Thanks - yes you can just turn off this option for Resource Dictionary files - however we will look at ignoring it automatically in these cases.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
bdwyer



Joined: 27 Aug 2012
Posts: 10

PostPosted: Wed Sep 12, 2012 10:01 pm    Post subject: Reply with quote

Hate to re-open this, but is there a way to use the ResXExtension inside resource dictionaries + DataTemplates?

The options listed below address the situation of the scanner automatically messing the dictionaries up, but I still like to use the ResXExtension to handle localization of content within my DataTemplates.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Sep 12, 2012 10:42 pm    Post subject: Reply with quote

You can use ResxExtension within ResourceDictionaries - you just have to turn the "Set default ResxName" option off. This means that when Globalizer scans and converts elements to use the ResxExtension it will specify the ResxName for each element (since it can't specify the ResxName at the top level).

Note that you can't use ResxExtension in Style Setters - see the following thread for more information:

http://www.infralution.com/phpBB2/viewtopic.php?t=2469
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Thu Feb 07, 2013 6:24 am    Post subject: Reply with quote

Version 3.5.0 of Globalizer has been released and fixes this issue so that the DefaultResxName is not set for ResourceDictionaries.
_________________
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