Skip to main content

Microsoft Silverlight

Answered Question Passing UiCulture via the ASP.NET Silverlight ControlRSS Feed

(0)

mpitzer
mpitzer

Member

Member

7 points

12 Posts

Passing UiCulture via the ASP.NET Silverlight Control

 Normally you pass culture information to silverlight by setting the following parameters in your HTML:

<param name="culture" value="fr-FR" />
<param name="uiculture" value="fr-FR" />

 

My question is, how is this done when if the ASP.NET server side control is used (ie System.Web.UI.SilverlightControls.Silverlight)?

It doesn't offer any Culture or UICulture properties.

Allen Chen – MSFT
Allen Ch...

Star

Star

13862 points

1,803 Posts

Answered Question

Re: Passing UiCulture via the ASP.NET Silverlight Control

Hi

You can use InitParameters to pass data. In aspx:

       <asp:Silverlight InitParameters="uiculture=fr-FR"

In App.xaml.cs add following code:

    private void Application_Startup(object sender, StartupEventArgs e)
        {
            if (e.InitParams["uiculture"] != null)
            {
                Thread.CurrentThread.CurrentUICulture =
                     new CultureInfo(e.InitParams["uiculture"]);
            }
            this.RootVisual = new Page();
        }

Sincerely,
Allen Chen
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.

mpitzer
mpitzer

Member

Member

7 points

12 Posts

Re: Re: Passing UiCulture via the ASP.NET Silverlight Control

 Cool, thanks :D

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities