Udostępnij za pośrednictwem


MapElement.MapStyleSheetEntryState Property

Definition

Gets or sets the name of the state of this MapElement. If the style sheet defines a style for that state, that style is applied to this element. Values defined in the style sheet for the state override values defined in the 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

Property Value

String

Platform::String

winrt::hstring

The name of the state of this MapElement.

Windows requirements

Device family
Windows 10 Fall Creators Update (introduced in 10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v5.0)

Examples

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

Remarks

Set this property to a string or to any of the property values available in the MapStyleSheetEntryStates class.

To learn more about entries in a map style sheet, see Map style sheet reference.

Applies to