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 

Resx namespace question

 
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: Tue May 17, 2016 7:57 pm    Post subject: Resx namespace question Reply with quote

Today one of our developers started experiencing some strange behavior related to the Resx extension in our WPF project. We use VS 2013, along with the latest version of R#. For some reason, R# has started prompting him to import the namespace for the Resx extension everywhere it's used in our XAML.

The odd thing is it's only happening to him ... nobody else on our team has experienced this yet. When he told me about this, it made me realize something I had never noticed about the Resx extension before - it doesn't require a namespace to be imported in the XAML to use it, even though it exists in the Infralution.Localization.Wpf namespace. How does that work? And do you have any idea why R# may have suddenly gotten confused by it?

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



Joined: 28 Feb 2005
Posts: 4972

PostPosted: Thu May 19, 2016 2:04 am    Post subject: Reply with quote

The Resx Extension uses the XmlnsDefinition attribute on the assembly to map Infralution.Localization.Wpf types in the base CLR namespace. See the following link for more information:

http://paulstovell.com/blog/xmlnsdefinition

The assembly attributes that do this haven't been updated since 2008 - but still appear to work for later visual studio versions - perhaps because they by default reference these namespaces. The definitions are in the ResxExtension are:

Code:
[assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "Infralution.Localization.Wpf")]
[assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2007/xaml/presentation", "Infralution.Localization.Wpf")]
[assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2008/xaml/presentation", "Infralution.Localization.Wpf")]


Perhaps the reason it isn't working for the developer is because their default namespaces do not include one of these?
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
kevinkuebler



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

PostPosted: Thu May 19, 2016 4:14 pm    Post subject: Reply with quote

Okay, thanks for the info. That's very interesting, I didn't know about that attribute. But I have seen the effect of it before, where control vendors often map all of their assembly's namespaces into one overall namespace (like the "http://xamlforge.com/magellan" example Paul used in that blog post). Makes sense now.

As for the one developer on our team who had this issue, it suddenly went away. He definitely had the normal default namespace defined ... he was seeing the issue on the same XAML files that the rest of us work on everyday. So I guess it was most likely just a flaky issue with R# that somehow resolved itself. Thanks for the info though!
Back to top
View user's profile Send private message
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