Skip to content

Latest commit

 

History

History
47 lines (37 loc) · 1.71 KB

mapelement_mapstylesheetentrystate.md

File metadata and controls

47 lines (37 loc) · 1.71 KB
-api-id -api-type
P:Windows.UI.Xaml.Controls.Maps.MapElement.MapStyleSheetEntryState
winrt property

Windows.UI.Xaml.Controls.Maps.MapElement.MapStyleSheetEntryState

-description

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.

-property-value

The name of the state of this MapElement.

-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.

-see-also

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