You have to hook up an handler to the legend Refreshed event and in this handler you can add/remove/change any items in the legend tree (from a layerItem, you can get the LayerItems children and so on if it's a group layer)
if (removeLayerItemVM != null) e.LayerItem.LayerItems.Remove(removeLayerItemVM);
private void Legend_Refreshed(object sender, Legend.RefreshedEventArgs e) { if (e.LayerItem.Layer.ID == "MyFeatureLayer") // could be a test on old label, layer type, url, ... e.LayerItem.Label = "MyAlias"; }
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.