views:

230

answers:

2

Hi all,

In 'normal' .Net, you can get the world's countries using the method described in this link.

Unfortunately, Silverlight doesn't support GetCultures or CultureTypes (yet?). Is there a way to get the countries in SL, without hard-coding them of course?

Thanks, Frances

+1  A: 

Well, those are "hardcoded" at some level. Countries of the world, as far as GetCulture is concerned is fairly static. You might as well use GetCultures to generate some code an wrap in a library where you can call your own such method. It's not like that method is calling some U.N. API over the Internet that is updated quarterly. :)

BobbyShaftoe
That's true, I guess, but what I like about the CultureInfo approach is that you can the countries in different languages (English name, Dutch name etc). This is import since the app should support localization later on, and I have no desire to hand-translate the country list myself :-)
And I used to be able to spell too... Sorry for the bad grammar in the previous comment.
+1  A: 

Expose this functionality using a webservice, then make a call from Silverlight to retrieve a list from server...

Michał Chaniewski