BingMapsTask.Center Property

May 11, 2014

Gets or sets the location that will be used as the center point for the map.

Namespace:  Microsoft.Phone.Tasks
Assembly:  Microsoft.Phone (in Microsoft.Phone.dll)
XMLNS for XAML: Not mapped to an xmlns.

public GeoCoordinate Center { get; set; }
<object>
  <object.Center>
    <GeoCoordinate .../>
  </object.Center>
</object>

Property Value

Type: System.Device.Location.GeoCoordinate
Type: GeoCoordinate. The center point of the map.

If you do not set the Center property before calling Show(), the user’s current location is used. You must set either the Center property or the SearchTerm property before calling Show or an InvalidOperationException will be thrown.

The GeoCoordinate type is found in the System.Device.Location namespace. To use it, you should add a reference to System.Device.dll to your application project and include the following using directive in your code.

using System.Device.Location;

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Windows Phone

Show:
© 2014 Microsoft