Hi,I am trying to bind to the LegendItemViewModel.Description
property but the value never shows up or defaults to the Map Services description. Yet all the other property values exists.
<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>
I debugged where the value gets set in LayerItemViewModel...
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;
and it seems that layerLegendInfo.LayerDescription is always null.I should add that this is a 10.0 service.