Label don't show After Define LabelDefinition for ArcGISMapImageSublayer

Discussion created by xiaoguang on Jul 19, 2017
Latest reply on Jul 28, 2017 by MStefarov-esristaff

Hi, I Define LabelDefinition for ArcGISMapImageSublayer after the ArcGISMapImagelayer loaded, but the labels don't show, the field is to be labeld is "name"


private async void ArcGISMapImageLayer_LoadStatusChanged(object sender, LoadStatusEventArgs e)
var lyr = sender as ArcGISMapImageLayer;

if (e.Status == LoadStatus.Loaded)
var subLyr = lyr.Sublayers[1] as ArcGISMapImageSublayer;
await subLyr.LoadAsync();
subLyr.LabelDefinitions.Add(LabelDefinition.FromJson("{\"labelExpression\": \"[name]\",\"labelPlacement\": \"esriServerPolygonPlacementAlwaysHorizontal\",\"symbol\": {\"color\": [255,0,255,123],\"font\": {\"size\": 16},\"type\": \"esriTS\"}}"));