Geographic​Region Geographic​Region Geographic​Region Class

Definition

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

public sealed class GeographicRegion : IGeographicRegionpublic sealed class GeographicRegion : IGeographicRegionPublic NotInheritable Class GeographicRegion Implements IGeographicRegion
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()

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

public GeographicRegion()public GeographicRegion()Public Sub New()
Attributes

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

Creates a GeographicRegion object.

public GeographicRegion(String geographicRegionCode)public GeographicRegion(String geographicRegionCode)Public Sub New(geographicRegionCode As String)
Parameters
geographicRegionCode
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

Properties

Code Code Code

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

public PlatForm::String Code { get; }public string Code { get; }Public ReadOnly Property Code As string
Value
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

CodeThreeDigit CodeThreeDigit CodeThreeDigit

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

public PlatForm::String CodeThreeDigit { get; }public string CodeThreeDigit { get; }Public ReadOnly Property CodeThreeDigit As string
Value
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

CodeThreeLetter CodeThreeLetter CodeThreeLetter

Gets the three-letter identifier for this region.

public PlatForm::String CodeThreeLetter { get; }public string CodeThreeLetter { get; }Public ReadOnly Property CodeThreeLetter As string
Value
string string string

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

Attributes

CodeTwoLetter CodeTwoLetter CodeTwoLetter

Gets the two-letter identifier for this region.

public PlatForm::String CodeTwoLetter { get; }public string CodeTwoLetter { get; }Public ReadOnly Property CodeTwoLetter As string
Value
string string string

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

Attributes

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>
Value

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

Attributes

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

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

public PlatForm::String DisplayName { get; }public string DisplayName { get; }Public ReadOnly Property DisplayName As string
Value
string string string

The localized name of the region.

Attributes

NativeName NativeName NativeName

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

public PlatForm::String NativeName { get; }public string NativeName { get; }Public ReadOnly Property NativeName As string
Value
string string string

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

Attributes

Methods

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

Determines whether a geographic region identifier is supported.

public static PlatForm::Boolean IsSupported(String geographicRegionCode)public static bool IsSupported(String geographicRegionCode)Public Static Function IsSupported(geographicRegionCode As String) As bool
Parameters
geographicRegionCode
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

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

See Also