Select to view content in your preferred language

Is there a way to define the size of the items in the legend?

2005
1
02-14-2013 01:22 AM
Labels (1)
ArielLomes
Deactivated User
Hello,

Is there any way to manipulate or control the size of the items in the legend in tree mode?

Thanks,

Ariel.
0 Kudos
1 Reply
DominiqueBroux
Esri Frequent Contributor
Depending on the type of legend item you want to customize, you can redefine the LegendItemTemplate and/or the LayerTemplate and/or the MapLayerTemplate.
For example to redefine the lower level of legend item (the level with a swatch and a label) you can redefine the LegendItemTemplate with XAML code like:

<esri:Legend Map=.........>
  <esri:Legend.LegendItemTemplate>
    <DataTemplate>
      <StackPanel Orientation="Horizontal">
        <Image Source="{Binding ImageSource}" HorizontalAlignment="Center" VerticalAlignment="Center"
          Stretch="None" MinWidth="20" />
        <TextBlock Text="{Binding Label}" Margin="5,0,0,0" VerticalAlignment="Center" />
      </StackPanel>
   </DataTemplate>
  </esri:Legend.LegendItemTemplate>
</esri:Legend>
0 Kudos