Retrieve Accept-Language browser settings in Silverlight
Every call to the server gets the Accept-开发者_StackOverflow社区Language value, but can I get that information within the Silverlight client?
I found System.Windows.Browser.HtmlPage.BrowserInformation
but it doesn't contain the user language preferences.
You mean the value that you would get via "Request.Headers["Accept-Language"]" in .net? I would just add a method to the web service that provides data to your silverlight to return it, then request it from Silverlight when the app starts up.
I usually back my Silverlight application with a server-side .net WCF service, so I would just add a method for this kind of information.
If you don't want a webservice method, you can also pass it to your Silverlight application at startup using initParms.
精彩评论