I'm doing a localization project and adding a lot of SupportCultures to my project file, e.g
<SupportedCultures>
en, de, es, fr, ja, zh-CN
</SupportedCultures>
In code, I am displaying a binding to a CultureViewModel and I need to make a CultureInfo obbject for each sup开发者_开发问答ported culture. Instead of doing this manually I would like to iterate through the collection in the project file - is there anyway to access these values in code?
TIA
Have a look at this blog entry. It shows how to enumerate the contents of a XAP file (it actually downloads one but you should simply open the AppManifest.xaml file from your own XAP).
Iterating over all AssemblyPart tags will give the list of all files making up the XAP file. All parts with a Source attribute ending in "resources.dll" will be one of the supported cultures. Its abbreviated name is the directory name of this part.
精彩评论