Share via


MapElement.MapStyleSheetEntryState Propriété

Définition

Obtient ou définit le nom de l’état de cet élément MapElement. Si la feuille de style définit un style pour cet état, ce style est appliqué à cet élément. Valeurs définies dans la feuille de style pour les valeurs de remplacement d’état définies dans mapStyleSheetEntry.

public:
 property Platform::String ^ MapStyleSheetEntryState { Platform::String ^ get(); void set(Platform::String ^ value); };
winrt::hstring MapStyleSheetEntryState();

void MapStyleSheetEntryState(winrt::hstring value);
public string MapStyleSheetEntryState { get; set; }
var string = mapElement.mapStyleSheetEntryState;
mapElement.mapStyleSheetEntryState = string;
Public Property MapStyleSheetEntryState As String

Valeur de propriété

String

Platform::String

winrt::hstring

Nom de l’état de cet élément MapElement.

Configuration requise pour Windows

Famille d’appareils
Windows 10 Fall Creators Update (introduit dans 10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduit dans v5.0)

Exemples

string myStyleSheetJson = @"{""version"": ""1.*"",
  ""extensions"":{
    ""myNamespace"":{
      ""myState"":{
        ""fillColor"":""#FF0000""}}}}";

this.map.StyleSheet = MapStyleSheet.ParseFromJson(myStyleSheetJson);
this.map.MapElements.Add(new MapIcon
{
  Location = new Geopoint(new BasicGeoposition { Latitude = 44, Longitude = -120 }),
  MapStyleSheetEntry = MapStyleSheetEntries.FoodPoint,
  MapStyleSheetEntryState = MapStyleSheetEntryStates.Selected,
});
this.map.MapElements.Add(new MapIcon
{
  Location = new Geopoint(new BasicGeoposition { Latitude = 47, Longitude = -120 }),
  MapStyleSheetEntry = MapStyleSheetEntries.FoodPoint,
  MapStyleSheetEntryState = "myNamespace.myState",
});

Remarques

Définissez cette propriété sur une chaîne ou sur l’une des valeurs de propriété disponibles dans la classe MapStyleSheetEntryStates .

Pour en savoir plus sur les entrées d’une feuille de style de carte, consultez Informations de référence sur la feuille de style de carte.

S’applique à