Share via


PlaceInfo Classe

Definizione

Visualizza una posizione della mappa e le informazioni che descrivono la posizione in una finestra non consentita che si chiude automaticamente quando l'utente fa clic all'esterno della finestra.

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
Ereditarietà
Object Platform::Object IInspectable PlaceInfo
Attributi

Requisiti Windows

Famiglia di dispositivi
Windows 10 Fall Creators Update (è stato introdotto in 10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (è stato introdotto in v5.0)

Esempio

Questo esempio mostra la posizione di Seattle Space Needle sotto il pulsante che l'utente fa clic per visualizzare tale posizione.

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

Commenti

Cronologia delle versioni

Versione di Windows Versione dell'SDK Valore aggiunto
1803 17134 CreateFromAddress(String)
1803 17134 CreateFromAddress(String,String)

Proprietà

DisplayAddress

Ottiene l'indirizzo associato a PlaceInfo.

DisplayName

Ottiene il nome visualizzato associato a PlaceInfo.

Geoshape

Ottiene la forma geografica associata a PlaceInfo.

Identifier

Ottiene l'identificatore associato a PlaceInfo.

IsShowSupported

Ottiene un valore che indica se l'app può visualizzare una finestra che contiene una posizione mappa e le informazioni correlate in base al contesto corrente.

Metodi

Create(Geopoint)

Crea un'istanza PlaceInfo .

Create(Geopoint, PlaceInfoCreateOptions)

Crea un'istanza PlaceInfo .

CreateFromAddress(String)

Crea un'istanza PlaceInfo usando un indirizzo.

CreateFromAddress(String, String)

Crea un'istanza PlaceInfo usando un indirizzo e un nome visualizzato.

CreateFromIdentifier(String)

Crea un'istanza PlaceInfo .

CreateFromIdentifier(String, Geopoint, PlaceInfoCreateOptions)

Crea un'istanza PlaceInfo .

CreateFromMapLocation(MapLocation)

Crea un'istanza PlaceInfo .

Show(Rect)

Viene visualizzata in una finestra popup, la posizione della mappa e le informazioni correlate descritte in PlaceInfo.

Show(Rect, Placement)

Mostra in una finestra chiara, la posizione della mappa e le informazioni correlate descritte in PlaceInfo.

Si applica a