Get the current region of Windows phone 8.1

I just ran into the problem of getting a user region in Windows Phone 8.1 (SilverLight) .

Situation: I set the region to United Kingdom and the language English(United States) (this is true).

In this case, I still get the UnitedState(US) using these methods:

  • 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 not they return the United Kingdom as a region?

+5
source share
2 answers

Based on my previous answer: WP 8.1 OS language detection

 string region = Windows.System.UserProfile.GlobalizationPreferences.HomeGeographicRegion; 
+5
source

You can use the RegionInfo.CurrentRegion property, as indicated here , which you usually use for WP8 or WP8.1.

Windows Phone 7 Home Country Discovery

0
source

Source: https://habr.com/ru/post/1206618/


All Articles