GeographicRegion GeographicRegion GeographicRegion GeographicRegion Class

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

Syntax

Declaration

public sealed class GeographicRegionpublic sealed class GeographicRegionPublic NotInheritable Class GeographicRegionpublic sealed class GeographicRegion

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 summary

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

Creates a GeographicRegion object.

Properties summary

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

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

Gets the three-letter identifier for this region.

Gets the two-letter identifier for this region.

Gets the set of currencies in use in this region.

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

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

Methods summary

Determines whether a geographic region identifier is supported.

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()
  • 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.

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; }

    Property 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".
  • 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; }

    Property 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".

  • 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; }

    Property Value

    • 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 string CodeTwoLetter { get; }public string CodeTwoLetter { get; }Public ReadOnly Property CodeTwoLetter As stringpublic string CodeTwoLetter { get; }

    Property Value

    • 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<string> CurrenciesInUse { get; }public IVectorView<string> CurrenciesInUse { get; }Public ReadOnly Property CurrenciesInUse As IVectorView<string>public IVectorView<string> CurrenciesInUse { get; }

    Property Value

    • 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 string DisplayName { get; }public string DisplayName { get; }Public ReadOnly Property DisplayName As stringpublic string DisplayName { get; }

    Property Value

    • 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 string NativeName { get; }public string NativeName { get; }Public ReadOnly Property NativeName As stringpublic string NativeName { get; }

    Property Value

    • 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 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.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ActivatableAttribute
Windows.Foundation.Metadata.ActivatableAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.DualApiPartitionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.ThreadingAttribute

Details

Assembly

Windows.Globalization.dll