ArcGIS API for Windows Phone - Library Reference
Legend Class
Members  See Also  Send comments on this topic
ESRI.ArcGIS.Client.Toolkit Namespace : Legend Class

Legend Control

Object Model

Legend ClassMap Class

Syntax

Visual Basic (Declaration) 
Public Class Legend 
   Inherits System.Windows.Controls.Control
C# 
public class Legend : System.Windows.Controls.Control 

Example

Allowing the user to toggle map service layers on and off and change opacity by overriding the MapLayerTemplate:

            <esri:Legend Map="{Binding ElementName=MyMap}" LayerItemsMode="Flat"
            	 ShowOnlyVisibleLayers="False">
            	<esri:Legend.MapLayerTemplate>
            		<DataTemplate>
            		<StackPanel Orientation="Horizontal">
            			<CheckBox Content="{Binding Label}"
            							IsChecked="{Binding IsEnabled, Mode=TwoWay}"
            							IsEnabled="{Binding IsInScaleRange}" >
            			</CheckBox>
            			<Slider Maximum="1" Value="{Binding Layer.Opacity, Mode=TwoWay}" Width="50" />
            		</StackPanel>
            	</DataTemplate>
            	</esri:Legend.MapLayerTemplate>
            </esri:Legend>
            

Allowing the user to toggle sub layers in a dynamic map service by overriding the LayerTemplate:

            <esri:Legend Map="{Binding ElementName=MyMap}" LayerItemsMode="Flat"
            	 ShowOnlyVisibleLayers="False">
            	<esri:Legend.LayerTemplate>
            		<DataTemplate>
            			<CheckBox Content="{Binding Label}"
            			IsChecked="{Binding IsEnabled, Mode=TwoWay}"
            				IsEnabled="{Binding IsInScaleRange}" >
            			</CheckBox>
            		</DataTemplate>
            	</esri:Legend.LayerTemplate>
            </esri:Legend>
            

Inheritance Hierarchy

System.Object
   System.Windows.DependencyObject
      System.Windows.UIElement
         System.Windows.FrameworkElement
            System.Windows.Controls.Control
               ESRI.ArcGIS.Client.Toolkit.Legend

Requirements

Target Platforms: Windows Vista, Windows 7

See Also

© ESRI, Inc. All Rights Reserved.