Skip to main content
GeographicRegion class

Applies to Windows and Windows Phone

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

Syntax


var geographicRegion = new Windows.Globalization.GeographicRegion(string);
var geographicRegion = new Windows.Globalization.GeographicRegion();

public sealed class GeographicRegion

Public NotInheritable Class GeographicRegion

public ref class GeographicRegion sealed 

Attributes

[ DualApiPartition()]
[ MarshalingBehavior(Agile)]
[ Threading(Both)]
[ Version(0x06020000)]

Members

The GeographicRegion class has these types of members:

Constructors

The GeographicRegion class has these constructors.

ConstructorDescription
GeographicRegion Creates a GeographicRegion object that defaults to the user's home region.
GeographicRegion(String) Creates a GeographicRegion object.

 

Methods

The GeographicRegion class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
IsSupported Determines whether a geographic region identifier is supported.

 

Properties

The GeographicRegion class has these properties.

PropertyAccess typeDescription

Code

Read-onlyGets the string that contains the best available identifier that represents the region.

CodeThreeDigit

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

CodeThreeLetter

Read-onlyGets the three-letter identifier for this region.

CodeTwoLetter

Read-onlyGets the two-letter identifier for this region.

CurrenciesInUse

Read-onlyGets the set of currencies in use in this region.

DisplayName

Read-onlyGets a localized string that is suitable for display to the user for identifying the region.

NativeName

Read-onlyGets the name of the region in the primary language spoken in this region.

 

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;

Requirements

Minimum supported client

Windows 8 [Windows Store apps, desktop apps]

Minimum supported server

Windows Server 2012 [Windows Store apps, desktop apps]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.Globalization
Windows::Globalization [C++]

Metadata

Windows.winmd