views:

453

answers:

2

I would like to know how I can configure my Silverlight application to be able to change the UICulture of the current thread without having to recompile the application.

If I set the current thread culture in the app.xaml, I need to recompile each time to change the culture. If I add an Application Settings, how can I retrieve that information on the client to be able to change the current thread culture info?

any ideas ?

A: 

There is a good article here on Silverlight localization.

Bryant
A: 

You can the culture from your html or aspx file that hosts the silverlight application. This would not require a recompile of your application but would require a refresh of the web page. This approach is dependent on the Culture Names list. Hope this helps.

Ex:

<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
      <param name="source" value="ClientBin/SL_Loc_Sample2.xap"/>
      <param name="onError" value="onSilverlightError" />
      <param name="background" value="white" />
      <param name="minRuntimeVersion" value="3.0.40624.0" />
      <param name="autoUpgrade" value="true" />
      <param name="culture" value="de" /> 
      <param name="uiculture" value="de" />
      <!--<param name="culture" value="fr" /> 
      <param name="uiculture" value="fr" />-->
      <!--<param name="culture" value="ja" /> 
      <param name="uiculture" value="ja" />-->
      <a href="http://go.microsoft.com/fwlink/?LinkID=149156&amp;v=3.0.40624.0" style="text-decoration:none">
          <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style:none"/>
      </a>
    </object>
Curtis