Windows phone 7 如何在Windows Phone应用程序的代码中设置UI语言?

Windows phone 7 如何在Windows Phone应用程序的代码中设置UI语言?,windows-phone-7,windows-phone-8,localization,windows-phone,Windows Phone 7,Windows Phone 8,Localization,Windows Phone,假设我的应用程序不支持区域性es MX,因此当这是手机上的当前设置时,我希望将区域性设置为es MX。这在Windows Phone中是否可以实现?如果可以,如何实现?这绝对是可能的! 有关区域性及其标识符,请参见 因此,例如,在App.xaml.cs构造函数中,您可以访问Thread.CurrentThread.CurrentCulture以确定应用程序运行的实际区域性。现在,如果您想强制UI使用其他区域性,可以通过设置CurrentUICulture来实现。例如: if (Thread.Cu

假设我的应用程序不支持区域性es MX,因此当这是手机上的当前设置时,我希望将区域性设置为es MX。这在Windows Phone中是否可以实现?如果可以,如何实现?

这绝对是可能的! 有关区域性及其标识符,请参见

因此,例如,在App.xaml.cs构造函数中,您可以访问Thread.CurrentThread.CurrentCulture以确定应用程序运行的实际区域性。现在,如果您想强制UI使用其他区域性,可以通过设置CurrentUICulture来实现。例如:

if (Thread.CurrentThread.CurrentCulture.Name.Equals("es-MX"))
{
    Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("es-ES");
}

这绝对是可能的! 有关区域性及其标识符,请参见

因此,例如,在App.xaml.cs构造函数中,您可以访问Thread.CurrentThread.CurrentCulture以确定应用程序运行的实际区域性。现在,如果您想强制UI使用其他区域性,可以通过设置CurrentUICulture来实现。例如:

if (Thread.CurrentThread.CurrentCulture.Name.Equals("es-MX"))
{
    Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("es-ES");
}