GeographicRegion GeographicRegion GeographicRegion GeographicRegion Class

Definition

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

public : sealed class GeographicRegion : IGeographicRegion
public sealed class GeographicRegion : IGeographicRegion
Public NotInheritable Class GeographicRegion Implements IGeographicRegion
var geographicRegion = new geographicRegion();
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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 GeographicRegion()
Public Sub New()
var geographicRegion = new geographicRegion();
See Also

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

Creates a GeographicRegion object.

public : GeographicRegion(Platform::String geographicRegionCode)
public GeographicRegion(String geographicRegionCode)
Public Sub New(geographicRegionCode As String)
var geographicRegion = new geographicRegion(geographicRegionCode);
Parameters
geographicRegionCode
Platform::String String String 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.

Properties

Code 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
var string = geographicRegion.code;
Value
Platform::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".

CodeThreeDigit 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
var string = geographicRegion.codeThreeDigit;
Value
Platform::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".

CodeThreeLetter 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
var string = geographicRegion.codeThreeLetter;
Value
Platform::String string string string

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

CodeTwoLetter 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
var string = geographicRegion.codeTwoLetter;
Value
Platform::String string string string

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

CurrenciesInUse CurrenciesInUse CurrenciesInUse CurrenciesInUse

Gets the set of currencies in use in this region.

public : IVectorView<Platform::String> CurrenciesInUse { get; }
public IReadOnlyList<string> CurrenciesInUse { get; }
Public ReadOnly Property CurrenciesInUse As IReadOnlyList<string>
var iReadOnlyList = geographicRegion.currenciesInUse;
Value
IVectorView<Platform::String> IReadOnlyList<string> IReadOnlyList<string> IReadOnlyList<string>

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

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 : Platform::String DisplayName { get; }
public string DisplayName { get; }
Public ReadOnly Property DisplayName As string
var string = geographicRegion.displayName;
Value
Platform::String string string string

The localized name of the region.

NativeName 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
var string = geographicRegion.nativeName;
Value
Platform::String string string string

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

Methods

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

Determines whether a geographic region identifier is supported.

public : static Platform::Boolean IsSupported(Platform::String geographicRegionCode)
public static bool IsSupported(String geographicRegionCode)
Public Static Function IsSupported(geographicRegionCode As String) As bool
var bool = Windows.Globalization.GeographicRegion.isSupported(geographicRegionCode);
Parameters
geographicRegionCode
Platform::String String String 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
Platform::Boolean 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.

See Also