Hi,I am trying to bind to the LegendItemViewModel.Description but the description never shows up. 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...
/// <summary>
/// Initializes a new instance of the <see cref="LayerItemViewModel"/> class from a <see cref="LayerLegendInfo"/>..
/// </summary>
/// <param name="layer">The layer.</param>
/// <param name="layerLegendInfo">The layer legend info.</param>
/// <param name="defaultLayerDescription">The default layer description (= the map layer description).</param>
/// <param name="map">The map.</param>
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.