GeographicRegion GeographicRegion GeographicRegion GeographicRegion Class

Definition

Describes a region. This is usually a country, but may be a macroregion.

public sealed class GeographicRegionpublic sealed class GeographicRegionPublic NotInheritable Class GeographicRegionpublic sealed class GeographicRegion
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Examples

// Get the user's geographic region and its display name.
var geographicRegion = new Windows.Globalization.GeographicRegion;
var displayName = geographicRegion.displayName;
// Get the user's geographic region and its display name.
var geographicRegion = new Windows.Globalization.GeographicRegion();
var displayName = geographicRegion.DisplayName;

Constructors

GeographicRegion() GeographicRegion() GeographicRegion() GeographicRegion()

Creates a GeographicRegion object that defaults to the user's home region.

public GeographicRegion()public New()Public Sub New()public GeographicRegion()
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

GeographicRegion(String) GeographicRegion(String) GeographicRegion(String) GeographicRegion(String)

Creates a GeographicRegion object.

public GeographicRegion(String geographicRegionCode)public New(String geographicRegionCode)Public Sub New(geographicRegionCode As String)public GeographicRegion(String geographicRegionCode)
Parameters
geographicRegionCode
System.String System.String System.String System.String

One of the ISO 3166-1 two-letter or three-letter codes that identify the country, or one of the three-digit UN-M49 codes that identify the geographical region.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Properties

Code Code Code Code

Gets the string that contains the best available identifier that represents the region.

public string Code { get; }public string Code { get; }Public ReadOnly Property Code As stringpublic string Code { get; }
Value
string string string string

Returns a string that contains:

  • The two-letter identifier code, if one exists (and is not "ZZ");
  • otherwise, the three-letter identifier code, if one exists (and is not "ZZZ");
  • otherwise, the three-digit numeric identifier code, if one exists (and is not "999");
  • otherwise, "ZZ".
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

CodeThreeDigit CodeThreeDigit CodeThreeDigit CodeThreeDigit

Gets the three-digit identifier for this region, as a string.

public string CodeThreeDigit { get; }public string CodeThreeDigit { get; }Public ReadOnly Property CodeThreeDigit As stringpublic string CodeThreeDigit { get; }
Value
string string string string

Returns as a string the ISO-3166-1 numeric three-digit code for the region, or the UN-M49 code. If the region is unknown, returns "999".

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

CodeThreeLetter CodeThreeLetter CodeThreeLetter CodeThreeLetter

Gets the three-letter identifier for this region.

public string CodeThreeLetter { get; }public string CodeThreeLetter { get; }Public ReadOnly Property CodeThreeLetter As stringpublic string CodeThreeLetter { get; }
Value
string string string string

Returns the three-letter ISO 3166-1 alpha-3 code for this region, if one exists; otherwise, returns "ZZZ".

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

CodeTwoLetter CodeTwoLetter CodeTwoLetter CodeTwoLetter

Gets the two-letter identifier for this region.

public string CodeTwoLetter { get; }public string CodeTwoLetter { get; }Public ReadOnly Property CodeTwoLetter As stringpublic string CodeTwoLetter { get; }
Value
string string string string

Returns the two-letter ISO 3166-1 alpha-2 code for this region, if one exists; otherwise, returns "ZZ".

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

CurrenciesInUse CurrenciesInUse CurrenciesInUse CurrenciesInUse

Gets the set of currencies in use in this region.

public IVectorView<string> CurrenciesInUse { get; }public IVectorView<string> CurrenciesInUse { get; }Public ReadOnly Property CurrenciesInUse As IVectorView<string>public IVectorView<string> CurrenciesInUse { get; }
Value

The set of ISO 4217 3-letter codes for the currencies that are used in the region.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

If the region is a country, there is typically one currency, although some countries do have more than one currency in use. If the region is larger, the returned set includes the currencies in use in each of the contained regions/countries.

DisplayName DisplayName DisplayName DisplayName

Gets a localized string that is suitable for display to the user for identifying the region.

public string DisplayName { get; }public string DisplayName { get; }Public ReadOnly Property DisplayName As stringpublic string DisplayName { get; }
Value
string string string string

The localized name of the region.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

NativeName NativeName NativeName NativeName

Gets the name of the region in the primary language spoken in this region.

public string NativeName { get; }public string NativeName { get; }Public ReadOnly Property NativeName As stringpublic string NativeName { get; }
Value
string string string string

The name of the region in the primary language spoken in this region.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Methods

IsSupported(String) IsSupported(String) IsSupported(String) IsSupported(String)

Determines whether a geographic region identifier is supported.

public static bool IsSupported(String geographicRegionCode)public static bool IsSupported(String geographicRegionCode)Public Static Function IsSupported(geographicRegionCode As String) As boolpublic static bool IsSupported(String geographicRegionCode)
Parameters
geographicRegionCode
System.String System.String System.String System.String

One of the ISO 3166-1 two-letter or three-letter codes that identify the country, or one of the three-digit UN-M49 codes that identify the geographical region.

Returns
bool bool bool bool

True if the ID is known; otherwise, ** false. If this method returns **true, an app can safely construct a region by using this region identifier. If it returns false, attempting to construct a region for the given code will throw an exception.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)