5

I am just facing a problem in getting the user set region in 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).

In that case I am still getting the region UnitedState(US) via 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 these not return United Kingdom as a region?

loop
  • 9,002
  • 10
  • 40
  • 76
  • How did you set the region? Did you set it correctly? – xmashallax Nov 11 '14 at 12:24
  • @xmashallax Yes, I had. I went to setting => region=> selected UnitedKingdom -(haven't change the language) => restarted phone => check again for region => it UK. – loop Nov 11 '14 at 12:27
  • Take a look at this StackO question/answers maybe you can find more info there: http://stackoverflow.com/questions/12560412/winrt-apps-and-regional-settings-the-correct-way-to-format-dates-and-numbers-ba – Depechie Nov 13 '14 at 14:54

2 Answers2

5

Building on my previous answer: Detect OS Language WP 8.1

string region =
    Windows.System.UserProfile.GlobalizationPreferences.HomeGeographicRegion;
Community
  • 1
  • 1
Chubosaurus Software
  • 8,133
  • 2
  • 20
  • 26
0

You could use the RegionInfo.CurrentRegion property as mentioned here which you normally use for WP8 or WP8.1.

Detecting home country of Windows Phone 7

Community
  • 1
  • 1
Kulasangar
  • 9,046
  • 5
  • 51
  • 82
  • not helpful already checked that.. I do not want the change in language. that is working. I want the change in country that can be changed without the change in language. – loop Nov 11 '14 at 18:07