简体   繁体   English

获取Windows Phone 8.1的当前区域

[英]Get Current Region of Windows phone 8.1

I am just facing a problem in getting the user set region in Windows Phone 8.1 (SilverLight) . 我只是在获取Windows Phone 8.1(SilverLight)中的用户设置区域时遇到问题。

Situation: I have set the Region to United Kingdom and the language to English(United States) (it is valid to do that). 情况:我将地区设置为United Kingdom ,将语言设置为English(United States) (这样做是有效的)。

In that case I am still getting the region UnitedState(US) via these methods: 在那种情况下,我仍然可以通过以下方法获得UnitedState(US)地区:

  • RegionInfo
  • Thread.CurrentThread
  • System.Globalization

     private static void GetRegion() { // all of the three returing UnitedStates. var dfg = RegionInfo.CurrentRegion; var cuture = Thread.CurrentThread.CurrentCulture; var cul = CultureInfo.CurrentCulture; } 

Why do these not return United Kingdom as a region? 为什么这些人不返回United Kingdom作为一个地区?

Building on my previous answer: Detect OS Language WP 8.1 基于我之前的答案: 检测OS语言WP 8.1

string region =
    Windows.System.UserProfile.GlobalizationPreferences.HomeGeographicRegion;

You could use the RegionInfo.CurrentRegion property as mentioned here which you normally use for WP8 or WP8.1. 您可以使用此处提到的RegionInfo.CurrentRegion属性,该属性通常用于WP8或WP8.1。

Detecting home country of Windows Phone 7 检测Windows Phone 7的本国

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM