PlaceInfo Klasse

Definition

Zeigt einen Kartenstandort und Informationen an, die diesen Standort beschreiben, in einem Fenster, das mit Licht ausschließt und automatisch geschlossen wird, wenn der Benutzer außerhalb des Fensters klickt.

public ref class PlaceInfo sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 327680)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class PlaceInfo final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 327680)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class PlaceInfo
Public NotInheritable Class PlaceInfo
Vererbung
Object Platform::Object IInspectable PlaceInfo
Attribute

Windows-Anforderungen

Gerätefamilie
Windows 10 Fall Creators Update (eingeführt in 10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (eingeführt in v5.0)

Beispiele

Dieses Beispiel zeigt die Position der Seattle Space Needle unter der Schaltfläche, auf die der Benutzer klickt, um diesen Speicherort zu sehen.

private void SpaceNeedle_Click(object sender, RoutedEventArgs e)
{
    Geopoint spaceNeedlePoint = new Geopoint
        (new BasicGeoposition { Latitude = 47.6205, Longitude = -122.3493 });

    PlaceInfoCreateOptions options = new PlaceInfoCreateOptions();

    options.DisplayAddress = "400 Broad St, Seattle, WA 98109";
    options.DisplayName = "Seattle Space Needle";

    PlaceInfo spaceNeedlePlace =  PlaceInfo.Create(spaceNeedlePoint, options);

    FrameworkElement targetElement = (FrameworkElement)sender;

    GeneralTransform generalTransform =
        targetElement.TransformToVisual((FrameworkElement)targetElement.Parent);

    Rect rectangle = generalTransform.TransformBounds(new Rect(new Point
        (targetElement.Margin.Left, targetElement.Margin.Top), targetElement.RenderSize));

    spaceNeedlePlace.Show(rectangle, Windows.UI.Popups.Placement.Below);
}

Hinweise

Versionsverlauf

Windows-Version SDK-Version Wertschöpfung
1803 17134 CreateFromAddress(String)
1803 17134 CreateFromAddress(String,String)

Eigenschaften

DisplayAddress

Ruft die Der PlaceInfo zugeordnete Adresse ab.

DisplayName

Ruft den Anzeigenamen ab, der placeInfo zugeordnet ist.

Geoshape

Ruft die geografische Form ab, die placeInfo zugeordnet ist.

Identifier

Ruft den Bezeichner ab, der PlaceInfo zugeordnet ist.

IsShowSupported

Ruft einen Wert ab, der angibt, ob Ihre App ein fenster mit Lichtausschluss anzeigen kann, das einen Kartenstandort und zugehörige Informationen im aktuellen Kontext enthält.

Methoden

Create(Geopoint)

Erstellt eine PlaceInfo-instance.

Create(Geopoint, PlaceInfoCreateOptions)

Erstellt eine PlaceInfo-instance.

CreateFromAddress(String)

Erstellt eine PlaceInfo-instance mithilfe einer Adresse.

CreateFromAddress(String, String)

Erstellt eine PlaceInfo-instance mithilfe einer Adresse und eines Anzeigenamens.

CreateFromIdentifier(String)

Erstellt eine PlaceInfo-instance.

CreateFromIdentifier(String, Geopoint, PlaceInfoCreateOptions)

Erstellt eine PlaceInfo-instance.

CreateFromMapLocation(MapLocation)

Erstellt eine PlaceInfo-instance.

Show(Rect)

Zeigt in einem Popupfenster den Kartenstandort und zugehörige Informationen an, die in PlaceInfo beschrieben sind.

Show(Rect, Placement)

Zeigt in einem lichtauslöschbaren Fenster den Kartenstandort und zugehörige Informationen an, die in placeInfo beschrieben werden.

Gilt für: