LegendItemViewModel.Description
<DataTemplate x:Key="LayerTemplate"> <StackPanel Margin="0,-1" Orientation="Horizontal" > <ToolTipService.ToolTip> <StackPanel MaxWidth="400"> <TextBlock FontWeight="Bold" Text="{Binding Path=Layer.ID }" TextWrapping="Wrap" /> <TextBlock FontWeight="Bold" Text="{Binding Path=Label}" TextWrapping="Wrap" /> <TextBlock Text="{Binding Path=Description}" /> <TextBlock Text="{Binding Path=SubLayerID, StringFormat='SubLayer ID : {0}'}" /> </StackPanel> </ToolTipService.ToolTip>
internal LayerItemViewModel(Layer layer, LayerLegendInfo layerLegendInfo, string defaultLayerDescription, Map map) : this(layer) { Debug.Assert(layerLegendInfo != null); Debug.Assert(map != null); // Needed to convert scale to resolution SubLayerID = layerLegendInfo.SubLayerID; Label = layerLegendInfo.LayerName; ParentLabel = layer.DisplayName ?? layer.ID; LayerType = layerLegendInfo.LayerType; IsHidden = layerLegendInfo.IsHidden; if (string.IsNullOrEmpty(layerLegendInfo.LayerDescription)) Description = defaultLayerDescription; else Description = layerLegendInfo.LayerDescription;
Sorry for the late reply, but LayerDescription returns the service description as it does in the example you have provided, not the description given to that particular feature layer.
Also, after scouring the LayerInfo for sub-layers during run time the LayerDescription object is always null.
The rest api doesn't seem to return the descriptions for the layers when doing a call to the map service.
Basically, I need to execute a ArcGISDynamicMapServiceLayer.GetAllDetails() so that I can populate the sub layers with the returned FeatureLayerInfo objects, specifically the layer descriptions.
Unless I've completely missed something about the ArcGISDynamicMapServiceLayer to tell it to return the FeatureLayerInfos on its own, which it doesn't seem to currently do.